(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.


Description: Compile time type converters.

Keywords: ecl converters

Tutorial Level: INTERMEDIATE


Convert from one type to another in compile time. Currently there is only the unsigned type converter.

   1 char c = 0x33;
   2 Unsigned<char>::type uc = 0x03;

That example is trivial, but is more useful when using it for template arguments in a class.

   1 template <typename T>
   2 class Foo {
   3 private:
   4     Unsigned<T>::type my_unsigned_variable;    
   5 };

Wiki: ecl_mpl/Tutorials/Converters (last edited 2012-01-27 00:20:15 by DanielStonier)