event_traits.hpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright 2025 Christian Granzin
  2. // Copyright 2008 Christophe Henry
  3. // henry UNDERSCORE christophe AT hotmail DOT com
  4. // This is an extended version of the state machine available in the boost::mpl library
  5. // Distributed under the same license as the original.
  6. // Copyright for the original version:
  7. // Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
  8. // under the Boost Software License, Version 1.0. (See accompanying
  9. // file LICENSE_1_0.txt or copy at
  10. // http://www.boost.org/LICENSE_1_0.txt)
  11. #ifndef BOOST_MSM_BACKMP11_EVENT_TRAITS_H
  12. #define BOOST_MSM_BACKMP11_EVENT_TRAITS_H
  13. #include <boost/msm/kleene_event.hpp>
  14. #include <any>
  15. namespace boost::msm
  16. {
  17. // add this way in this namespace specializations for events which you want to use as kleene
  18. // requirement: a copy-constructor matching the events which will be converted to this kleene
  19. template <>
  20. struct is_kleene_event<std::any> : std::true_type {};
  21. } // boost::msm
  22. namespace boost::msm::backmp11
  23. {
  24. // Import std::any_cast for overload resolution:
  25. // In case boost::any is used as Kleene event,
  26. // overload resolution will pick boost::any_cast for us.
  27. using std::any_cast;
  28. } // boost::msm::backmp11
  29. #endif //BOOST_MSM_EVENT_TRAITS_H