CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
npstat::Element1D< Container, Result > Struct Template Reference

#include <SimpleFunctors.h>

Inheritance diagram for npstat::Element1D< Container, Result >:
npstat::Functor1< Result, Container >

Public Member Functions

 Element1D (const unsigned long index)
 
 Element1D ()=delete
 
Result operator() (const Container &c) const
 
- Public Member Functions inherited from npstat::Functor1< Result, Container >
virtual ~Functor1 ()
 

Private Attributes

unsigned long idx
 

Additional Inherited Members

- Public Types inherited from npstat::Functor1< Result, Container >
typedef Container first_argument_type
 
typedef Result result_type
 

Detailed Description

template<class Container, class Result = typename Container::value_type>
struct npstat::Element1D< Container, Result >

Functor which extracts a given element from a random access linear container without bounds checking

Definition at line 184 of file SimpleFunctors.h.

Constructor & Destructor Documentation

◆ Element1D() [1/2]

template<class Container , class Result = typename Container::value_type>
npstat::Element1D< Container, Result >::Element1D ( const unsigned long  index)
inlineexplicit

Definition at line 185 of file SimpleFunctors.h.

◆ Element1D() [2/2]

template<class Container , class Result = typename Container::value_type>
npstat::Element1D< Container, Result >::Element1D ( )
delete

Member Function Documentation

◆ operator()()

template<class Container , class Result = typename Container::value_type>
Result npstat::Element1D< Container, Result >::operator() ( const Container &  c) const
inlinevirtual

Implements npstat::Functor1< Result, Container >.

Definition at line 187 of file SimpleFunctors.h.

References c, and npstat::Element1D< Container, Result >::idx.

187 { return c[idx]; }
unsigned long idx

Member Data Documentation

◆ idx

template<class Container , class Result = typename Container::value_type>
unsigned long npstat::Element1D< Container, Result >::idx
private