19 May
2017
19 May
'17
2:12 p.m.
On Fri, May 19, 2017 at 7:05 AM, Niall Douglas via Boost
... The hack is the above. We cache the address of the canonical singleton, and the noinline seems to cause the optimiser to disregard the thread fence and thus to not give up quickly. The resulting assembler generated is greatly improved on MSVC, a single result<T> shrinks from ~260 opcodes to less than 5.
As I use error categories extensively in my library, a blog post or article focusing on this technique would be useful (if it doesn't already exist).