aimstil  5.0.5
value_proxy_policies.h
Go to the documentation of this file.
1 #ifndef TIL_VALUE_PROXY_POLICY_H
2 #define TIL_VALUE_PROXY_POLICY_H
3 
4 // includes from TIL
5 #include "til/traits.h"
6 
7 namespace til { namespace policy
8 {
9 
11  template < typename TContainer, typename TIndex >
13  {
14  public: // typedefs
15 
16  typedef typename TContainer::value_type value_type;
17  //typedef typename reference_of<TContainer>::type reference;
18  typedef typename TContainer::const_reference const_reference;
19  typedef typename TContainer::const_pointer const_pointer;
20 
21  public: // functions
22 
24  //static value_type get(TContainer * pContainer, TIndex i)
25  //{ return pContainer->get(i); }
26  static const_reference get(TContainer & container, TIndex i)
27  { return container.get(i); }
28 
29  static const_pointer getPointer(TContainer & container, TIndex i)
30  { return container.getPointer(i); }
31 
33  //static void set(TContainer * pContainer, TIndex i, value_type value)
34  //{ return pContainer->set(i, value); }
35  static void set(TContainer & container, TIndex i, value_type value)
36  { container.set(i, value); }
37  };
38 
39 }} // namespace til::policy
40 
41 #endif
42 
TContainer::value_type value_type
TContainer::const_reference const_reference
Belongs to package Box Do not include directly, include til/Box.h instead.
Definition: Accumulator.h:10
TContainer::const_pointer const_pointer
static const_pointer getPointer(TContainer &container, TIndex i)
Policy for value_proxy that defines how it should access the container elements.