From b274d8b4a18402fd280d8856861eb14aa198a9bf Mon Sep 17 00:00:00 2001 From: md Date: Tue, 14 Mar 2017 22:52:17 +0100 Subject: [PATCH] Move stuff related to implementation to detail namespace --- project/include/variadic/at.hpp | 27 ++++++---- project/include/variadic/first.hpp | 28 ++++++---- project/include/variadic/last.hpp | 45 +++++++++------- project/include/variadic/merge.hpp | 31 ++++++----- project/include/variadic/nested_type.hpp | 36 ++++++++----- project/include/variadic/reverse.hpp | 31 ++++++----- project/include/variadic/skip.hpp | 65 +++++++++++++----------- 7 files changed, 154 insertions(+), 109 deletions(-) diff --git a/project/include/variadic/at.hpp b/project/include/variadic/at.hpp index eac6e79..86f9051 100644 --- a/project/include/variadic/at.hpp +++ b/project/include/variadic/at.hpp @@ -27,23 +27,28 @@ namespace variadic // using type = typename at::type; // }; - template > - struct at_frame_impl; - - template - struct at_frame_impl> + namespace detail { - template - static T deducer(decltype((void*)Ignore)..., T*, ...); - }; - template - using at_frame = decltype(at_frame_impl::deducer(static_cast*>(nullptr)...)); + template > + struct at_frame_impl; + + template + struct at_frame_impl> + { + template + static T deducer(decltype((void*)Ignore)..., T*, ...); + }; + + template + using at_frame = decltype(at_frame_impl::deducer(static_cast*>(nullptr)...)); + + } // namespace detail template struct at { - using type = typename at_frame::type; + using type = typename detail::at_frame::type; }; } // namespace variadic \ No newline at end of file diff --git a/project/include/variadic/first.hpp b/project/include/variadic/first.hpp index 108aa30..8d31beb 100644 --- a/project/include/variadic/first.hpp +++ b/project/include/variadic/first.hpp @@ -10,18 +10,26 @@ namespace variadic { - template - struct first; + namespace detail + { - template <> - struct first<> - {}; + template + struct first_frame; - template - struct first - { - using type = T; - }; + template <> + struct first_frame<> + {}; + + template + struct first_frame + { + using type = T; + }; + + } // namespace detail + + template + using first = detail::first_frame; template using not_first = collection; diff --git a/project/include/variadic/last.hpp b/project/include/variadic/last.hpp index 1958444..7dee8d4 100644 --- a/project/include/variadic/last.hpp +++ b/project/include/variadic/last.hpp @@ -32,29 +32,38 @@ namespace variadic // using type = typename last::type; // }; - template - struct last; - - template <> - struct last<> - {}; - template - struct last + namespace detail { - using type = typename at::type; - }; - template - struct not_last_frame; + template + struct last_frame; - template - struct not_last_frame, Types...> - { - using types = collection::type...>; - }; + template <> + struct last_frame<> + {}; + + template + struct last_frame + { + using type = typename at::type; + }; + + template + struct not_last_frame; + + template + struct not_last_frame, Types...> + { + using types = collection::type...>; + }; + + } // namespace detail + + template + using last = detail::last_frame; template - using not_last = typename not_last_frame, Types...>::types; + using not_last = typename detail::not_last_frame, Types...>::types; } // namespace variadic \ No newline at end of file diff --git a/project/include/variadic/merge.hpp b/project/include/variadic/merge.hpp index cb3206c..b3e3912 100644 --- a/project/include/variadic/merge.hpp +++ b/project/include/variadic/merge.hpp @@ -10,23 +10,28 @@ namespace variadic { - template - struct merge_frame; - - template - struct merge_frame + namespace detail { - using types = ResultCollection; - }; - template - struct merge_frame - { - using types = typename merge_frame, Collections...>::types; - }; + template + struct merge_frame; + + template + struct merge_frame + { + using types = ResultCollection; + }; + + template + struct merge_frame + { + using types = typename merge_frame, Collections...>::types; + }; + + } // namespace detail template - using merge = typename merge_frame, Collections...>::types; + using merge = typename detail::merge_frame, Collections...>::types; template struct merge_types diff --git a/project/include/variadic/nested_type.hpp b/project/include/variadic/nested_type.hpp index 4191f8b..a54938d 100644 --- a/project/include/variadic/nested_type.hpp +++ b/project/include/variadic/nested_type.hpp @@ -8,21 +8,29 @@ namespace variadic { - template