roboptim::detail::const_ref< T > Struct Template Reference

Return the proper const reference type of a given type. More...

#include <roboptim/core/detail/utility.hh>

List of all members.

Public Types

typedef boost::mpl::if_
< is_eigen_type< T >
, const_eigen_ref< T >
, boost::add_reference
< typename boost::add_const< T >
::type > >::type::type 
type

Detailed Description

template<typename T>
struct roboptim::detail::const_ref< T >

Return the proper const reference type of a given type.

For instance: const_ref<float>::value_t == const float& const_ref<argument_t>::value_t == const_argument_ref

This returns a const Eigen::Ref for dense Eigen matrices, else a simple const reference.

Note: this currently does not cover all cases (e.g. sparse vectors), but should work for argument_t/vector_t (dense vectors).

Template Parameters:
Ttype.

Member Typedef Documentation

template<typename T>
typedef boost::mpl::if_<is_eigen_type<T>, const_eigen_ref<T>, boost::add_reference<typename boost::add_const<T>::type> >::type::type roboptim::detail::const_ref< T >::type
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines