is_actor.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*==============================================================================
  2. Copyright (c) 2005-2010 Joel de Guzman
  3. Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. ==============================================================================*/
  6. #ifndef BOOST_PHOENIX_CORE_IS_ACTOR_HPP
  7. #define BOOST_PHOENIX_CORE_IS_ACTOR_HPP
  8. #include <boost/mpl/bool.hpp>
  9. // Note to Thomas and any future maintainer: please make this as
  10. // lightweight as possible (as it is right now).
  11. namespace boost { namespace phoenix
  12. {
  13. ///////////////////////////////////////////////////////////////////////////////
  14. //
  15. // is_actor<T>
  16. //
  17. // Tests if T is an actor. Evaluates to mpl::true_ or mpl::false_
  18. //
  19. ///////////////////////////////////////////////////////////////////////////////
  20. template <typename Expr>
  21. struct actor;
  22. template <typename T, typename Enable = void>
  23. struct is_actor
  24. : mpl::false_
  25. {};
  26. template <typename T>
  27. struct is_actor<T const>
  28. : is_actor<T>
  29. {};
  30. template <typename T>
  31. struct is_actor<T &>
  32. : is_actor<T>
  33. {};
  34. template <typename Expr>
  35. struct is_actor<actor<Expr> >
  36. : mpl::true_
  37. {};
  38. }}
  39. #endif