diff --git a/include/boost/mp11/detail/mpl_common.hpp b/include/boost/mp11/detail/mpl_common.hpp new file mode 100644 index 0000000..208885c --- /dev/null +++ b/include/boost/mp11/detail/mpl_common.hpp @@ -0,0 +1,160 @@ +#ifndef BOOST_MP11_DETAIL_MPL_COMMON_HPP_INCLUDED +#define BOOST_MP11_DETAIL_MPL_COMMON_HPP_INCLUDED + +// Copyright 2017, 2019 Peter Dimov. +// +// Distributed under the Boost Software License, Version 1.0. +// +// See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt + +#include +#include + +namespace boost +{ +namespace mpl +{ + +struct forward_iterator_tag; + +namespace aux +{ + +struct mp11_tag {}; + +template struct mp11_iterator +{ + using category = forward_iterator_tag; + + using type = mp11::mp_first; + using next = mp11_iterator>; +}; + +} // namespace aux + +// at + +template< typename Tag > struct at_impl; + +template<> struct at_impl +{ + template struct apply + { + using type = mp11::mp_at; + }; +}; + +// back + +template< typename Tag > struct back_impl; + +template<> struct back_impl +{ + template struct apply + { + using N = mp11::mp_size; + using type = mp11::mp_at_c; + }; +}; + +// begin + +template< typename Tag > struct begin_impl; + +template<> struct begin_impl +{ + template struct apply + { + using type = aux::mp11_iterator; + }; +}; + +// clear + +template< typename Tag > struct clear_impl; + +template<> struct clear_impl +{ + template struct apply + { + using type = mp11::mp_clear; + }; +}; + +// end + +template< typename Tag > struct end_impl; + +template<> struct end_impl +{ + template struct apply + { + using type = aux::mp11_iterator>; + }; +}; + +// front + +template< typename Tag > struct front_impl; + +template<> struct front_impl +{ + template struct apply + { + using type = mp11::mp_front; + }; +}; + +// pop_front + +template< typename Tag > struct pop_front_impl; + +template<> struct pop_front_impl +{ + template struct apply + { + using type = mp11::mp_pop_front; + }; +}; + +// push_back + +template< typename Tag > struct push_back_impl; + +template<> struct push_back_impl +{ + template struct apply + { + using type = mp11::mp_push_back; + }; +}; + +// push_front + +template< typename Tag > struct push_front_impl; + +template<> struct push_front_impl +{ + template struct apply + { + using type = mp11::mp_push_front; + }; +}; + +// size + +template< typename Tag > struct size_impl; + +template<> struct size_impl +{ + template struct apply + { + using type = mp11::mp_size; + }; +}; + +} // namespace mpl +} // namespace boost + +#endif // #ifndef BOOST_MP11_DETAIL_MPL_COMMON_HPP_INCLUDED diff --git a/include/boost/mp11/mpl.hpp b/include/boost/mp11/mpl.hpp index 0e836cb..994705f 100644 --- a/include/boost/mp11/mpl.hpp +++ b/include/boost/mp11/mpl.hpp @@ -1,175 +1,14 @@ #ifndef BOOST_MP11_MPL_HPP_INCLUDED #define BOOST_MP11_MPL_HPP_INCLUDED -// Copyright 2017 Peter Dimov. +// Copyright 2017, 2019 Peter Dimov. // // Distributed under the Boost Software License, Version 1.0. // // See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt -#include -#include -#include - -namespace boost -{ -namespace mpl -{ - -struct forward_iterator_tag; - -namespace aux -{ - -struct mp11_tag {}; - -template struct mp11_iterator -{ - using category = forward_iterator_tag; - - using type = mp11::mp_first; - using next = mp11_iterator>; -}; - -} // namespace aux - -// at - -template< typename Tag > struct at_impl; - -template<> struct at_impl -{ - template struct apply - { - using type = mp11::mp_at; - }; -}; - -// back - -template< typename Tag > struct back_impl; - -template<> struct back_impl -{ - template struct apply - { - using N = mp11::mp_size; - using type = mp11::mp_at_c; - }; -}; - -// begin - -template< typename Tag > struct begin_impl; - -template<> struct begin_impl -{ - template struct apply - { - using type = aux::mp11_iterator; - }; -}; - -// clear - -template< typename Tag > struct clear_impl; - -template<> struct clear_impl -{ - template struct apply - { - using type = mp11::mp_clear; - }; -}; - -// end - -template< typename Tag > struct end_impl; - -template<> struct end_impl -{ - template struct apply - { - using type = aux::mp11_iterator>; - }; -}; - -// front - -template< typename Tag > struct front_impl; - -template<> struct front_impl -{ - template struct apply - { - using type = mp11::mp_front; - }; -}; - -// pop_front - -template< typename Tag > struct pop_front_impl; - -template<> struct pop_front_impl -{ - template struct apply - { - using type = mp11::mp_pop_front; - }; -}; - -// push_back - -template< typename Tag > struct push_back_impl; - -template<> struct push_back_impl -{ - template struct apply - { - using type = mp11::mp_push_back; - }; -}; - -// push_front - -template< typename Tag > struct push_front_impl; - -template<> struct push_front_impl -{ - template struct apply - { - using type = mp11::mp_push_front; - }; -}; - -// sequence_tag - -template< typename Sequence > struct sequence_tag; - -template struct sequence_tag> -{ - using type = aux::mp11_tag; -}; - -template struct sequence_tag> -{ - using type = aux::mp11_tag; -}; - -// size - -template< typename Tag > struct size_impl; - -template<> struct size_impl -{ - template struct apply - { - using type = mp11::mp_size; - }; -}; - -} // namespace mpl -} // namespace boost +#include +#include #endif // #ifndef BOOST_MP11_MPL_HPP_INCLUDED diff --git a/include/boost/mp11/mpl_list.hpp b/include/boost/mp11/mpl_list.hpp new file mode 100644 index 0000000..643da43 --- /dev/null +++ b/include/boost/mp11/mpl_list.hpp @@ -0,0 +1,28 @@ +#ifndef BOOST_MP11_MPL_LIST_HPP_INCLUDED +#define BOOST_MP11_MPL_LIST_HPP_INCLUDED + +// Copyright 2017, 2019 Peter Dimov. +// +// Distributed under the Boost Software License, Version 1.0. +// +// See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt + +#include + +namespace boost +{ +namespace mpl +{ + +template< typename Sequence > struct sequence_tag; + +template struct sequence_tag> +{ + using type = aux::mp11_tag; +}; + +} // namespace mpl +} // namespace boost + +#endif // #ifndef BOOST_MP11_MPL_LIST_HPP_INCLUDED diff --git a/include/boost/mp11/mpl_tuple.hpp b/include/boost/mp11/mpl_tuple.hpp new file mode 100644 index 0000000..b6900b1 --- /dev/null +++ b/include/boost/mp11/mpl_tuple.hpp @@ -0,0 +1,29 @@ +#ifndef BOOST_MP11_MPL_TUPLE_HPP_INCLUDED +#define BOOST_MP11_MPL_TUPLE_HPP_INCLUDED + +// Copyright 2017, 2019 Peter Dimov. +// +// Distributed under the Boost Software License, Version 1.0. +// +// See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt + +#include +#include + +namespace boost +{ +namespace mpl +{ + +template< typename Sequence > struct sequence_tag; + +template struct sequence_tag> +{ + using type = aux::mp11_tag; +}; + +} // namespace mpl +} // namespace boost + +#endif // #ifndef BOOST_MP11_MPL_TUPLE_HPP_INCLUDED