How do I write an ADL-enabled trailing return type, or noexcept specification?

I think I would move it into a separate namespace namespace tricks { using std::swap; template <typename T, typename U> void swap(T &t, U &u) noexcept(noexcept(swap(t, u))); } template <typename T> void swap(my_template<T>& x, my_template<T>& y) noexcept(noexcept(tricks::swap(std::declval<T>(), std::declval<T>()))) { using std::swap; swap(x.something_that_is_a_T, y.something_that_is_a_T); } Alternatively you can move the whole code up into tricks and … Read more

noexcept, stack unwinding and performance

There’s “no” overhead and then there’s no overhead. You can think of the compiler in different ways: It generates a program which performs certain actions. It generates a program satisfying certain constraints. The TR says there’s no overhead in the table-driven appraoch because no action needs to be taken as long as a throw doesn’t … Read more

What is the difference between C++03 `throw()` specifier and C++11 `noexcept`?

Exception specifiers were deprecated because exception specifiers are generally a terrible idea. noexcept was added because it’s the one reasonably useful use of an exception specifier: knowing when a function won’t throw an exception. Thus it becomes a binary choice: functions that will throw and functions that won’t throw. noexcept was added rather than just … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)