That's basically what I did in the previous post, the only differences are:
1) You're using boosts version of integral (which I didn't know about), however I could make my integral struct a wrapper for integral_c (since integral_c specifies one additional template parameter that will always be the same in this case).
2) You're specifying "using namespace" inside of namespace scope, which extends out into global namespace. 'using' does not respect namespace scope. This conflicts with a lot of objects I have defined outside of the namespace.
Thanks for your help.
--- Robert Dailey wrote:Try this:
> So far, this is all I've been able to come up with:
>
> #include <boost/mpl/map.hpp>
> #include <boost/mpl/at.hpp>
>
> namespace detail
> {
> template< unsigned int t_value >
> struct integral
> {
> static const unsigned int value = t_value;
> };
>
> typedef boost::mpl::map<
> boost::mpl::pair<float, integral<GL_FLOAT>
> >,
>
> boost::mpl::pair<double, integral<GL_DOUBLE>
> >
> > glTypeMap;
> };
>
> template< typename t_type >
> struct Vertex
> {
> static const unsigned int type =
> boost::mpl::at<detail::glTypeMap,
> t_type>::type::value;
> t_type x, y, z;
> };
#include <boost/mpl/integral_c.hpp>#include <boost/mpl/map.hpp>using namespace boost;
#include <boost/mpl/at.hpp>
namespace detail {
using namespace mpl;
typedef map<
pair<
float
, integral_c<unsigned int,GL_FLOAT>
>
, pair<
double
, integral_c<unsigned int,GL_DOUBLE>>at<glTypeMap,t_type>::type::value;
> glTypeMap;
template <typename t_type>
struct Vertex
{
static const unsigned int type =t_type x, y, z;} // namespace detail
};
HTH,
Cromwell D. Enage
____________________________________________________________________________________
Be a better pen pal.
Text or chat with friends inside Yahoo! Mail. See how. http://overview.mail.yahoo.com/
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users