From 562eba5f689faf6d45a5fcf78ad42d22eecc8c50 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Fri, 28 May 2021 02:40:19 +0200 Subject: [PATCH] Delete sequence_bt.hpp This stuff has been in the standard lib for a long time now. --- include/duckhandy/sequence_bt.hpp | 54 ------------------------------- include/duckhandy/string_bt.hpp | 12 +++---- 2 files changed, 6 insertions(+), 60 deletions(-) delete mode 100644 include/duckhandy/sequence_bt.hpp diff --git a/include/duckhandy/sequence_bt.hpp b/include/duckhandy/sequence_bt.hpp deleted file mode 100644 index ee92e92..0000000 --- a/include/duckhandy/sequence_bt.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright 2016-2021 Michele Santullo - * This file is part of "duckhandy". - * - * "duckhandy" is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * "duckhandy" is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with "duckhandy". If not, see . - */ - -#ifndef id4FAEF395B9ED47CB9D6B50B54C9A289A -#define id4FAEF395B9ED47CB9D6B50B54C9A289A - -#include - -namespace dhandy { - namespace bt { - template - struct number_seq { - }; - - template - using index_seq = number_seq; - - namespace implem { - template - struct range_builder; - - template - struct range_builder { - typedef number_seq type; - }; - - template - struct range_builder : public range_builder { - }; - } //namespace implem - - template - using number_range = typename implem::range_builder::type; - - template - using index_range = number_range; - } //namespace bt -} //namespace dhandy - -#endif diff --git a/include/duckhandy/string_bt.hpp b/include/duckhandy/string_bt.hpp index a7f1862..9d6cdb6 100644 --- a/include/duckhandy/string_bt.hpp +++ b/include/duckhandy/string_bt.hpp @@ -18,7 +18,7 @@ #ifndef id170B0E6C34D14EBA9B92A35977BDBFB3 #define id170B0E6C34D14EBA9B92A35977BDBFB3 -#include "sequence_bt.hpp" +#include #include #include #include @@ -58,7 +58,7 @@ namespace dhandy { private: template - constexpr string ( const index_seq&, const value_type* parString ); + constexpr string ( const std::index_sequence&, const value_type* parString ); const value_type m_data[S]; }; @@ -70,7 +70,7 @@ namespace dhandy { namespace implem { template - constexpr string concat ( const index_seq&, const string& parLeft, const string& parRight ) { + constexpr string concat ( const std::index_sequence&, const string& parLeft, const string& parRight ) { return string( (I < S - 1 ? parLeft[I] : (I < S + S2 - 2 ? parRight[I - (S - 1)] : '\0'))... ); @@ -83,14 +83,14 @@ namespace dhandy { template template - constexpr string::string (const index_seq&, const value_type* parString) : + constexpr string::string (const std::index_sequence&, const value_type* parString) : m_data{parString[I]...} { } template inline constexpr string::string (const value_type* parString) : - string(index_range<0, S>(), parString) + string(std::make_index_sequence(), parString) { } @@ -104,7 +104,7 @@ namespace dhandy { template template constexpr inline string string::operator+ (const string& parOther) const { - return implem::concat(index_range<0, S + S2 - 1>(), string(m_data), parOther); + return implem::concat(std::make_index_sequence(), string(m_data), parOther); } template