Use boost::declval instead of std::declval, close #10190.

since GCC 4.4 has no std::declval.
I tested on CentOS6 with GCC 4.4.7.

see https://svn.boost.org/trac/boost/ticket/10190
Thanks-to: Niklas Angare