Boost logo

Boost Users :

From: Robert Dailey (rcdailey_at_[hidden])
Date: 2007-11-17 00:38:22


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.

On Nov 16, 2007 8:22 PM, Cromwell Enage < sponage_at_[hidden]> wrote:

> --- Robert Dailey wrote:
> > 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;
> > };
>
> Try this:
>
> #include <boost/mpl/integral_c.hpp>
> #include <boost/mpl/map.hpp>
> #include <boost/mpl/at.hpp>
>
> namespace detail {
> using namespace boost;
> using namespace mpl;
>
> typedef map<
> pair<
> float
> , integral_c<unsigned int,GL_FLOAT>
> >
> , pair<
> double
> , integral_c<unsigned int,GL_DOUBLE>
> >
> > glTypeMap;
>
> template <typename t_type>
> struct Vertex
> {
> static const unsigned int type =
> at<glTypeMap,t_type>::type::value;
> 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_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net