[prev in list] [next in list] [prev in thread] [next in thread] 

List:       boost-users
Subject:    Re: [Boost-users] [ Boost.Units ] Invert a quantity_type
From:       Steven Watanabe via Boost-users <boost-users () lists ! boost ! org>
Date:       2017-06-08 19:51:52
Message-ID: 5939AAD8.2030008 () providere-consulting ! com
[Download RAW message or body]

AMDG

On 06/06/2017 05:12 PM, Belcourt, Kenneth via Boost-users wrote:
> 
> I have a structure that is passed some type from which I can extract a units \
> quantity type: 
> <snip>
> 
> Is there a way to invert a quantity type so I can compute and return, say, the \
> inverse of the passed quantity_type?  So, for example, is there any Boost.Units \
> inverse meta like function that might let me say something like this: 
> <snip>
> I'm hoping for something more general than partially specializing the bu::inverse \
> method for each quantity I may want to invert.  Any ideas? 

There isn't a specific inverse function, but,
shouldn't divide_typeof_helper work or
power_typeof_helper<T, -1> work?  (or better
just use decltype)

In Christ,
Steven Watanabe

_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
https://lists.boost.org/mailman/listinfo.cgi/boost-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic