|
Boost Users : |
Subject: Re: [Boost-users] [Boost.Units] Trouble with I/O and specific scaled units
From: Michael Powell (mwpowellnm_at_[hidden])
Date: 2011-10-21 12:21:33
On Fri, Oct 21, 2011 at 9:55 AM, Steven Watanabe <watanabesj_at_[hidden]>wrote:
> AMDG
>
> On 10/20/2011 06:24 PM, Michael J Iatauro wrote:
> > typedef make_scaled_unit<second, scale<60, static_rational<1> > >::type
> > minute;
> >
> > <snip>
> >
> > I tried adding
> >
> > std::string name_string(const minute&) {
> > return "min";
> > }
> >
> > std::string symbol_string(const minute&) {
> > return "min";
> > }
> >
> > but that didn't change anything. Interestingly, if I change the scale
> > from 60 to 10, it compiles and runs fine. What am I missing?
> >
>
> Where did you put the overloads? They
> need to go in namespace boost::units, to
> be found by ADL.
>
Ah! Actually, I bumped into this one not long ago. Instead of boost::units I
was building up a namespace along the lines cs:units for our company's
name-sake and to avoid too much in the way of namespace collusion. So in
that case, I would still need my names and symbols kept in boost::units.
> In Christ,
> Steven Watanabe
> _______________________________________________
> 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