Boost logo

Boost Users :

Subject: Re: [Boost-users] Importing namespaced templates
From: John Maddock (john_at_[hidden])
Date: 2009-02-16 08:14:21


> from the C++0x standard, 7.3.3 (5) I gather that it is not possible to
> write a
> using statement to import a templated function into the global namespace.
> E.g.
>
> #include <boost/units/quantity.hpp>
>
> using template<typename X, typename Y> boost::units::quantity_cast<X,Y>;
>
> will be malformed. The only alternatives I have been able to come up with
> are
> 1) Use boost::units::quantity_cast<X>(Y) which is a bit longwinded
> 2) Write a new quantity_cast in the global namespace, and forward it to
> the
> boost::units one.
>
> Is there a better way?

using boost::units::quantity_cast;

will do what you want.

John.


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