From e6cef7e3ee718971b5076c787f75a3d826aab411 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Thu, 13 Aug 2020 20:46:58 +0100 Subject: [PATCH] Get rid of lexical_cast. This stuff is quite old and I don't think I ever felt confident enough to use it in real code. --- .gitignore | 1 + include/duckhandy/int_to_string_ary.hpp | 39 --- include/duckhandy/lexical_cast.hpp | 316 ------------------------ test/unit/CMakeLists.txt | 1 - test/unit/lexical_cast_test.cpp | 108 -------- 5 files changed, 1 insertion(+), 464 deletions(-) delete mode 100644 include/duckhandy/int_to_string_ary.hpp delete mode 100644 include/duckhandy/lexical_cast.hpp delete mode 100644 test/unit/lexical_cast_test.cpp diff --git a/.gitignore b/.gitignore index f8f1c27..922973f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ tags compile_commands.json +.clangd diff --git a/include/duckhandy/int_to_string_ary.hpp b/include/duckhandy/int_to_string_ary.hpp deleted file mode 100644 index 98ae0c0..0000000 --- a/include/duckhandy/int_to_string_ary.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright 2016-2018 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 idB123739E9F8846899541DB26BEA86386 -#define idB123739E9F8846899541DB26BEA86386 - -#include "lexical_cast.hpp" - -namespace dhandy { - namespace customize { - template - struct array_to_t> { - static MaxSizedArray make (MaxSizedArray&& parIn) { - return parIn; - } - }; - } //namespace customize - - template class Tag=tags::dec, typename F=void> - inline auto int_to_string_ary (const F& parFrom) -> MaxSizedArray::count_digits_bt(sprout::numeric_limits::max())> { - return dhandy::lexical_cast::count_digits_bt(sprout::numeric_limits::max())>, Tag, F>(parFrom); - } -} //namespace dhandy - -#endif diff --git a/include/duckhandy/lexical_cast.hpp b/include/duckhandy/lexical_cast.hpp deleted file mode 100644 index af855fe..0000000 --- a/include/duckhandy/lexical_cast.hpp +++ /dev/null @@ -1,316 +0,0 @@ -/* Copyright 2016-2018 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 id942A6B5AB2AF443C82D4321775BFC9E8 -#define id942A6B5AB2AF443C82D4321775BFC9E8 - -#include "compatibility.h" -#include "sequence_bt.hpp" -#include "MaxSizedArray.hpp" -#include "has_method.hpp" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace dhandy { - namespace customize { - template - struct index_to_char; - - template - struct char_to_int; - - template - struct array_to_t; - } //namespace customize - - namespace implem { - template - typename std::make_unsigned::type abs ( T parValue ) a_pure; - - template int count_leading_zeroes ( typename std::enable_if::is_signed, T>::type parValue ) a_always_inline; - template int count_leading_zeroes ( typename std::enable_if::is_signed, T>::type parValue ) a_always_inline; - int count_leading_zeroes_overload ( unsigned char parValue ) a_always_inline; - int count_leading_zeroes_overload ( unsigned short int parValue ) a_always_inline; - int count_leading_zeroes_overload ( unsigned int parValue ) a_always_inline; - int count_leading_zeroes_overload ( unsigned long parValue ) a_always_inline; - int count_leading_zeroes_overload ( unsigned long long parValue ) a_always_inline; - - template - struct power { - enum { value = Base * power::value }; - }; - template - struct power { - enum { value = 1 }; - }; - - template ::is_signed> - struct is_negative; - template - struct is_negative { - static int check (T parValue) { return (parValue < 0 ? 1 : 0); } - }; - template - struct is_negative { - static constexpr int check (T) { return 0; } - }; - - - template