On Dec 2, 2009, at 3:03 PM, Steven Watanabe wrote:
AMDG
James C. Sutherland wrote:
Thank you! That works great for pointers, but now not for POD, e.g., const int m = get<int>(p,"int"); Any ideas of how to get this to work with POD and pointers?
typename boost::mpl::eval_if
::type , boost::add_const<T> ::type
In Christ, Steven Watanabe
You can work magic! I suppose that I need to dig into MPL and the type_traits libraries in boost. template< typename T > typename boost::mpl::eval_if< boost::is_pointer<T>, boost::add_pointer< typename boost::add_const< typename boost::remove_pointer<T>::type >::type >, boost::add_const<T> >::type get( const Properties& p, const std::string name ) { ... } that did the job.