FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
Loading...
Searching...
No Matches
functor Namespace Reference

This namespace defines a few useful functors. More...

Classes

class  Cast
 Cast functor: returns its argument of type ARG casted to type RES. More...
 
class  ChangeEndianness
 Endianness change functor: will change from big to little or little to big endian format on integer types. More...
 
class  Compose
 Composition functor: applies 2 functors one after each other. More...
 
class  Constant
 Constant functor: always returns a constant value. More...
 
struct  Functor
 Utility to instantiate and execute a functor from its type. More...
 
class  Identity
 Identity functor: always returns its argument, unchanged. More...
 

Detailed Description

This namespace defines a few useful functors.

All functors defined here are classes with operator(). Each functor also has the following available types defined:

  • ARG_TYPE the type of its argument
  • RES_TYPE the type of its result

These functors are heavily used in I2C devices, applied to Futures classes.