Boost logo

Boost Users :

Subject: [Boost-users] Importing namespaced templates
From: Esben Mose Hansen (boost_at_[hidden])
Date: 2009-02-16 07:07:39


Hi,

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?

(Sorry that this is only borderline a boost question)

-- 
kind regards, Esben

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