
On Thu, Jun 4, 2009 at 8:03 AM, Gevorg Voskanyan <v_gevorg@yahoo.com> wrote:
template < typename Div_type > typename boost::disable_if_c< sizeof(Div_type) <= sizeof(size_t), void
::type foo( /*args*/ ) { // fallback to std::sort BOOST_STATIC_WARNING( sizeof(Div_type) <= sizeof(size_t) ); // BOOST_STATIC_WARNING( false ); won't work because the expression must depend on a template parameter }
Thanks Gevorg, that's what I needed. integer_sort is now safe against too-large data types, and the default float_sort is safe against bad casts. The warning message is confusing, but it's a compile-time warning, which is what I need to let the user know that there is a problem. Is it bad for my unit tests to be issuing intentional static warnings?