control_constructs_common.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Boost Lambda Library -- control_constructs_common.hpp -------------------
  2. // Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
  3. // Copyright (C) 2000 Gary Powell (powellg@amazon.com)
  4. //
  5. // Distributed under the Boost Software License, Version 1.0. (See
  6. // accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. //
  9. // For more information, see www.boost.org
  10. // --------------------------------------------------------------------------
  11. #if !defined(BOOST_CONTROL_CONSTRUCTS_COMMON_HPP)
  12. #define BOOST_CONTROL_CONSTRUCTS_COMMON_HPP
  13. namespace boost {
  14. namespace lambda {
  15. // special types of lambda functors, used with control structures
  16. // to guarantee that they are composed correctly.
  17. template<class Tag, class LambdaFunctor>
  18. class tagged_lambda_functor;
  19. template<class Tag, class Args>
  20. class tagged_lambda_functor<Tag, lambda_functor<Args> >
  21. : public lambda_functor<Args>
  22. {
  23. public:
  24. tagged_lambda_functor(const Args& a) : lambda_functor<Args>(a) {}
  25. tagged_lambda_functor(const lambda_functor<Args>& a)
  26. : lambda_functor<Args>(a) {}
  27. // for the no body cases in control structures.
  28. tagged_lambda_functor() : lambda_functor<Args>() {}
  29. };
  30. } // lambda
  31. } // boost
  32. #endif // BOOST_CONTROL_CONSTRUCTS_COMMON_HPP