![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
#include <derived_data.h>
Public Member Functions | |
template<typename AttrT> | |
ValueType< AllAttrs::GetIndex< AttrT >()> & | operator[] (AttrT a) |
template<typename AttrT> | |
const ValueType< AllAttrs::GetIndex< AttrT >()> & | operator[] (AttrT a) const |
template<typename Fn> | |
void | ForEachAttrValue (Fn &&fn) |
A map of attribute to ValueType<i>, where i is the index of the attribute type. See AttrMapTest for example usage.
Definition at line 147 of file derived_data.h.
|
inline |
Applies fn on each value for each attribute type. fn must have a overload set of operator() that accepts a ValueType<i> for i in 0..AllAttrs::kSize. This cannot be an iterator because value types are not homogeneous.
Definition at line 168 of file derived_data.h.
|
inline |
Definition at line 150 of file derived_data.h.
|
inline |
The const_cast is fine because non-const operator[] does not mutate anything and we're casting the return type back to const.
Definition at line 157 of file derived_data.h.