Posted Mar 8, 2013 19:49 UTC (Fri) by Cyberax (✭ supporter ✭, #52523)
In reply to: MSVC by jwakely
Parent article: Michaelsen: One
Ok. I'll bite.
You CAN'T use constexprs to solve the initialization ordering problem. By definition constexprs can't have any side effects (in fact, allowing side effects is a compiler bug). This means that constexprs can refer to each other and can have any ordering.
So using constexprs to allocate a mutex is right out. The only remaining usages:
1) Precalculating complex mathematics formulae. It's right out - you can't really do anything real-world interesting in 512 level recursion limit.
2) Template mindfskery - instead of using partial template specialization. That cleans up code somewhat, but it still doesn't change the fsked up nature of template metaprogramming.