[Boost-bugs] [Boost C++ Libraries] #6119: output streams not working with units

Subject: [Boost-bugs] [Boost C++ Libraries] #6119: output streams not working with units
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-11-12 16:41:45


#6119: output streams not working with units
-------------------------------------+--------------------------------------
 Reporter: noel_belcourt | Owner: matthiasschabel
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: units
  Version: Boost Development Trunk | Severity: Problem
 Keywords: |
-------------------------------------+--------------------------------------
 Compiling the temperature.cpp example problems fails with this error
 message

 S896822:example kbelco$ icpc -g -I ../../.. temperature.cpp
 ../../../boost/units/io.hpp(967): error: more than one instance of
 overloaded function "boost::units::detail::do_print_prefixed" matches the
 argument list:
             function template "void
 boost::units::detail::do_print_prefixed<Prefixes,CharT,Traits,Dimension,L,Scale,T>(std::basic_ostream<_CharT,
 _Traits> &, const boost::units::quantity<boost::units::unit<Dimension,
 boost::units::heterogeneous_system<boost::units::heterogeneous_system_impl<L,
 Dimension, Scale>>, void>, T> &)"
             function template "void
 boost::units::detail::do_print_prefixed<Prefixes,CharT,Traits,Dimension,System,T>(std::basic_ostream<_CharT,
 _Traits> &, const boost::units::quantity<boost::units::unit<Dimension,
 System, void>, T> &)"
             function template "void
 boost::units::detail::do_print_prefixed<Prefixes,CharT,Traits,Unit,T>(std::basic_ostream<_CharT,
 _Traits> &, const boost::units::quantity<Unit, T> &)"
             argument types are: (std::basic_ostream<char,
 std::char_traits<char>>, const
 boost::units::quantity<boost::units::fahrenheit::temperature, double>)
       detail::do_print_prefixed<Prefixes>(os, q);
       ^
           detected during:
             instantiation of "void
 boost::units::detail::maybe_print_prefixed<Prefixes,CharT,Traits,Unit,T>(std::basic_ostream<_CharT,
 _Traits> &, const boost::units::quantity<Unit, T> &, boost::mpl::true_)
 [with Prefixes=boost::units::detail::engineering_prefixes, CharT=char,
 Traits=std::char_traits<char>, Unit=boost::units::fahrenheit::temperature,
 T=double]" at line 1050
             instantiation of "std::basic_ostream<_CharT, _Traits>
 &boost::units::operator<<(std::basic_ostream<_CharT, _Traits> &, const
 boost::units::quantity<Unit2, T2> &) [with Char=char,
 Traits=std::char_traits<char>, Unit=boost::units::fahrenheit::temperature,
 T=double]" at line 92 of "temperature.cpp"

 The same message occurs with a small reproducer.

 #include <iostream>
 #include <boost/units/io.hpp>
 #include <boost/units/quantity.hpp>
 #include <boost/units/systems/temperature/fahrenheit.hpp>

 int main(int, char **) {
   using namespace boost::units;
   quantity<fahrenheit::temperature> t;
   cout << t << endl;
   return 0;
 }

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6119>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC