Base Framework
Public Member Functions | Protected Attributes | List of all members
Sum< TYPE, RESULT > Class Template Reference

Summation function object. More...

#include <base/Functor.h>

Inherits UnaryOperation< TYPE, TYPE >.

Public Member Functions

void operator() (const TYPE &value) noexcept
 
RESULT getResult () const noexcept
 

Protected Attributes

RESULT result = 0
 

Additional Inherited Members

- Public Types inherited from UnaryOperation< TYPE, TYPE >
typedef TYPE Argument
 
typedef TYPE Result
 

Detailed Description

template<class TYPE, class RESULT = TYPE>
class Sum< TYPE, RESULT >

Summation function object.

This function object calculate the sum of a sequence of objects.

Examples
testsuite/Array.cpp, testsuite/du.cpp, testsuite/HashSet.cpp, testsuite/List.cpp, and testsuite/Set.cpp.