From ca6ddb26fead7f1ed967805a9652d0f4bab8d8f0 Mon Sep 17 00:00:00 2001 From: Robert Ramey Date: Tue, 14 Sep 2004 04:31:29 +0000 Subject: [PATCH] m initial check in [SVN r25070] --- include/boost/mpl/apply_if.hpp | 53 ++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 include/boost/mpl/apply_if.hpp diff --git a/include/boost/mpl/apply_if.hpp b/include/boost/mpl/apply_if.hpp new file mode 100644 index 0000000..227e5ab --- /dev/null +++ b/include/boost/mpl/apply_if.hpp @@ -0,0 +1,53 @@ +//----------------------------------------------------------------------------- +// boost/mpl/apply_if.hpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2004 +// Robert Ramey +// +// Permission to use, copy, modify, distribute and sell this software +// and its documentation for any purpose is hereby granted without fee, +// provided that the above copyright notice appears in all copies and +// that both the copyright notice and this permission notice appear in +// supporting documentation. No representations are made about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. + +// apply_if is deprecated. Use eval_if instead. This is only included +// to support older code like spirit 1.6 + +#ifndef BOOST_MPL_APPLY_IF_HPP_INCLUDED +#define BOOST_MPL_APPLY_IF_HPP_INCLUDED + +#include "boost/mpl/eval_if.hpp" + +namespace boost { +namespace mpl { + +template< + typename C + , typename F1 + , typename F2 + > +struct apply_if +{ + typedef BOOST_DEDUCED_TYPENAME eval_if::type type; +}; + +// (almost) copy & paste in order to save one more +// recursively nested template instantiation to user +template< + bool C + , typename F1 + , typename F2 + > +struct apply_if_c +{ + typedef BOOST_DEDUCED_TYPENAME eval_if_c::type type; +}; + +} // namespace mpl +} // namespace boost + +#endif // BOOST_MPL_APPLY_IF_HPP_INCLUDED