CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
22 #include <type_traits>
24 namespace catapult {
namespace utils {
28 template<
typename TContainer,
typename TInitial,
typename TFunction>
29 auto Reduce(
const TContainer& container, TInitial initialValue, TFunction fun) {
30 for (
const auto& element : container)
31 initialValue = fun(initialValue, element);
38 template<
typename TContainer,
typename TFunction>
39 auto Sum(
const TContainer& container, TFunction accessor) {
40 std::invoke_result_t<TFunction, typename TContainer::value_type> sum = 0;
42 for (
const auto& element : container)
43 sum += accessor(element);
mode
Definition: forwardsValidation.py:80
def _collectNsName(self)
Definition: forwardsValidation.py:183
Definition: SimpleValidator.py:1
def _collectOpeningBrace(self)
Definition: forwardsValidation.py:223
def formatError(err)
Definition: forwardsValidation.py:341
def _collectTypeName(self)
Definition: forwardsValidation.py:237
def __init__(self, errorReporter)
Definition: forwardsValidation.py:71
Definition: forwardsValidation.py:67
def _getPath(self)
Definition: forwardsValidation.py:169
def finalize(self)
Definition: forwardsValidation.py:323
def __init__(self)
Definition: forwardsValidation.py:18
def _keywordCheck(self)
Definition: forwardsValidation.py:138
def _addForward(self, typeType, typeName)
Definition: forwardsValidation.py:207
Definition: forwardsValidation.py:17
Definition: SimpleValidator.py:9
lastName
Definition: forwardsValidation.py:87
def reset(self, path)
Definition: forwardsValidation.py:76
def _collectSemiColon(self)
Definition: forwardsValidation.py:229
hadForwards
Definition: forwardsValidation.py:89
lastNamespaceLineNumber
Definition: forwardsValidation.py:92
def createDict()
Definition: forwardsValidation.py:62
previousBlockLineNumber
Definition: forwardsValidation.py:94
Definition: colorPrint.py:1
Definition: forwardsValidation.py:57
auto Sum(const TContainer &container, TFunction accessor)
Definition: Functional.h:39
declarations
Definition: forwardsValidation.py:85
def _parse(self, lineNumber, line)
Definition: forwardsValidation.py:105
errorReporter
Definition: SimpleValidator.py:11
lastLineNumber
Definition: forwardsValidation.py:91
matchLineNumber
Definition: forwardsValidation.py:78
def _collectNamespaceKeyword(self)
Definition: forwardsValidation.py:175
typeType
Definition: forwardsValidation.py:86
tokenizer
Definition: forwardsValidation.py:82
namespaceStack
Definition: forwardsValidation.py:84
tok
Definition: forwardsValidation.py:83
def _skipTillEol(self)
Definition: forwardsValidation.py:264
parsingDone
Definition: forwardsValidation.py:79
def __next__(self)
Definition: forwardsValidation.py:41
def info(*args)
Definition: forwardsValidation.py:12
Definition: forwardsValidation.py:46
def __iter__(self)
Definition: forwardsValidation.py:27
def feed(self, line)
Definition: forwardsValidation.py:23
tokPos
Definition: forwardsValidation.py:131
auto Reduce(const TContainer &container, TInitial initialValue, TFunction fun)
Definition: Functional.h:29
path
Definition: SimpleValidator.py:22
string NAME
Definition: forwardsValidation.py:69
line
Definition: forwardsValidation.py:116
patternNamespace
Definition: forwardsValidation.py:73
def _formatFwd(className, classSpec)
Definition: forwardsValidation.py:269
def _collectEnum(self)
Definition: forwardsValidation.py:241
line
Definition: forwardsValidation.py:19
def check(self, lineNumber, line)
Definition: forwardsValidation.py:97
lex
Definition: forwardsValidation.py:20
Definition: AddressExtractionExtension.cpp:28
namespaceType
Definition: forwardsValidation.py:81
collectedLines
Definition: forwardsValidation.py:95
preTypeLines
Definition: forwardsValidation.py:88
lastNamespaceNextLineLength
Definition: forwardsValidation.py:93
lastForwardLineNumber
Definition: forwardsValidation.py:90
def indentNotEmpty(line)
Definition: forwardsValidation.py:279
def _format(declarations, level=1)
Definition: forwardsValidation.py:283
def find(self)
Definition: forwardsValidation.py:30