sl@0: // Boost.Range library sl@0: // sl@0: // Copyright Thorsten Ottosen 2003-2004. Use, modification and sl@0: // distribution is subject to the Boost Software License, Version sl@0: // 1.0. (See accompanying file LICENSE_1_0.txt or copy at sl@0: // http://www.boost.org/LICENSE_1_0.txt) sl@0: // sl@0: // For more information, see http://www.boost.org/libs/range/ sl@0: // sl@0: sl@0: #ifndef BOOST_RANGE_EMPTY_HPP sl@0: #define BOOST_RANGE_EMPTY_HPP sl@0: sl@0: #if defined(_MSC_VER) && (_MSC_VER >= 1200) sl@0: # pragma once sl@0: #endif sl@0: sl@0: #include sl@0: //#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING sl@0: //#include sl@0: //#else sl@0: sl@0: #include sl@0: #include sl@0: sl@0: namespace boost sl@0: { sl@0: namespace range_detail sl@0: { sl@0: sl@0: ////////////////////////////////////////////////////////////////////// sl@0: // primary template sl@0: ////////////////////////////////////////////////////////////////////// sl@0: sl@0: template< typename C > sl@0: inline bool empty( const C& c ) sl@0: { sl@0: return boost::begin( c ) == boost::end( c ); sl@0: } sl@0: sl@0: ////////////////////////////////////////////////////////////////////// sl@0: // string sl@0: ////////////////////////////////////////////////////////////////////// sl@0: sl@0: inline bool empty( const char* const& s ) sl@0: { sl@0: return s == 0 || s[0] == 0; sl@0: } sl@0: sl@0: inline bool empty( const wchar_t* const& s ) sl@0: { sl@0: return s == 0 || s[0] == 0; sl@0: } sl@0: sl@0: } // namespace 'range_detail' sl@0: sl@0: template< class T > sl@0: inline bool empty( const T& r ) sl@0: { sl@0: return range_detail::empty( r ); sl@0: } sl@0: sl@0: } // namepace 'boost' sl@0: sl@0: //#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING sl@0: sl@0: #endif