CppNoddy  0.92
Loading...
Searching...
No Matches
Public Member Functions | List of all members
CppNoddy::scale_functor< _containerType, _valueType > Class Template Reference

A unary pure function object that scales through multiplication. More...

#include <Functors.h>

Inheritance diagram for CppNoddy::scale_functor< _containerType, _valueType >:

Public Member Functions

 scale_functor (_valueType value)
 
_containerType operator() (_containerType elt)
 

Detailed Description

template<class _containerType, typename _valueType>
class CppNoddy::scale_functor< _containerType, _valueType >

A unary pure function object that scales through multiplication.

The object is type templated for any object that defines operator* and the MULTIPLIER is set in the functor constructor.

Definition at line 74 of file Functors.h.

Constructor & Destructor Documentation

◆ scale_functor()

template<class _containerType , typename _valueType >
CppNoddy::scale_functor< _containerType, _valueType >::scale_functor ( _valueType  value)
inline
Parameters
valueThe value to be used in the scale operation

Definition at line 77 of file Functors.h.

77 : std::unary_function< _valueType, _containerType>() {
78 MULTIPLIER = value;
79 }

Member Function Documentation

◆ operator()()

template<class _containerType , typename _valueType >
_containerType CppNoddy::scale_functor< _containerType, _valueType >::operator() ( _containerType  elt)
inline
Returns
The operator*( elt, value) operation where value is specified in the constructor

Definition at line 83 of file Functors.h.

83 {
84 return elt * MULTIPLIER;
85 }

The documentation for this class was generated from the following file:

© 2012

R.E. Hewitt