Boost logo

Boost :

Subject: Re: [boost] [config] [chrono] consexpr workaround
From: John Maddock (boost.regex_at_[hidden])
Date: 2013-03-19 13:51:38


> My initial reasoning was based on this: I analysed performance of some
> C++03 code, that uses Boost.Chrono. And I discovered, that a lot of
> trivial
> functions didn't get inlined. So now, narrowing the question to use of
> BOOST_CONSTEXPR in Boost.Chrono:
> 1. Could the functions marked BOOST_CONSTEXPR be also marked inline (and
> this question probably applies to other Boost libraries)?
> 2. This is probably related only to the TI compiler I use: marking
> constructors inline doesn't work for me, they need to be marked
> BOOST_FORCEINLINE (I've configured it), so could the constexpr
> constructors
> in Boost.Chrono be marked with BOOST_FORCEINLINE as well?

If you mean:

BOOST_FORCEINLINE BOOST_CONSTEXPR T foo();

Then yes, that's what Multiprecision does for performance critical
functions.

John.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk