empty.hpp 893 B

12345678910111213141516171819202122232425262728293031323334
  1. ///////////////////////////////////////////////////////////////////////////////
  2. /// \file empty.hpp
  3. /// Proto callables for boost::empty()
  4. //
  5. // Copyright 2012 Eric Niebler. Distributed under the Boost
  6. // Software License, Version 1.0. (See accompanying file
  7. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  8. #ifndef BOOST_PROTO_FUNCTIONAL_RANGE_EMPTY_HPP_EAN_27_08_2012
  9. #define BOOST_PROTO_FUNCTIONAL_RANGE_EMPTY_HPP_EAN_27_08_2012
  10. #include <boost/range/empty.hpp>
  11. #include <boost/proto/proto_fwd.hpp>
  12. namespace boost { namespace proto { namespace functional
  13. {
  14. // A PolymorphicFunctionObject that wraps boost::empty()
  15. struct empty
  16. {
  17. BOOST_PROTO_CALLABLE()
  18. typedef bool result_type;
  19. template<typename Rng>
  20. bool operator()(Rng const &rng) const
  21. {
  22. return boost::empty(rng);
  23. }
  24. };
  25. }}}
  26. #endif