From 2867cd79ef0531006143a605bfaa1691131d6204 Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Fri, 21 Feb 2014 00:25:55 +0900 Subject: [PATCH] add SPROUT_DEPRECATED --- sprout/array/make_array.hpp | 2 ++ sprout/config/compiler/borland.hpp | 1 + sprout/config/compiler/clang.hpp | 4 ++++ sprout/config/compiler/codegear.hpp | 1 + sprout/config/compiler/common_edg.hpp | 1 + sprout/config/compiler/digitalmars.hpp | 1 + sprout/config/compiler/gcc.hpp | 4 ++++ sprout/config/compiler/gcc_xml.hpp | 1 + sprout/config/compiler/has_future.hpp | 3 +++ sprout/config/compiler/metrowerks.hpp | 1 + sprout/config/compiler/mpw.hpp | 1 + sprout/config/compiler/no_future.hpp | 3 +++ sprout/config/compiler/pathscale.hpp | 1 + sprout/config/compiler/pgi.hpp | 1 + sprout/config/compiler/sunpro_cc.hpp | 1 + sprout/config/compiler/vacpp.hpp | 1 + sprout/config/compiler/visualc.hpp | 1 + sprout/config/suffix.hpp | 11 +++++++++++ sprout/string/to_string_array.hpp | 2 ++ sprout/string/to_string_value.hpp | 3 ++- 20 files changed, 43 insertions(+), 1 deletion(-) diff --git a/sprout/array/make_array.hpp b/sprout/array/make_array.hpp index fbb98ce4..48355426 100644 --- a/sprout/array/make_array.hpp +++ b/sprout/array/make_array.hpp @@ -51,8 +51,10 @@ namespace sprout { // // convert_array + // [[deprecated]] // template + SPROUT_DEPRECATED inline SPROUT_CONSTEXPR sprout::array convert_array(Converter&& conv, Types&&... args) { return sprout::make_array(sprout::forward(conv)(sprout::forward(args))...); diff --git a/sprout/config/compiler/borland.hpp b/sprout/config/compiler/borland.hpp index 7d378ff3..7ddf9b30 100644 --- a/sprout/config/compiler/borland.hpp +++ b/sprout/config/compiler/borland.hpp @@ -19,6 +19,7 @@ #define SPROUT_NO_CXX11_USER_DEFINED_LITERALS #define SPROUT_NO_CXX11_DELEGATING_CONSTRUCTORS #define SPROUT_NO_CXX11_UNICODE_LITERALS +#define SPROUT_NO_CXX11_ATTRIBUTES #define SPROUT_NO_CXX14_CONSTEXPR #define SPROUT_NO_CXX14_VARIABLE_TEMPLATES diff --git a/sprout/config/compiler/clang.hpp b/sprout/config/compiler/clang.hpp index d76aeebb..8e84cde3 100644 --- a/sprout/config/compiler/clang.hpp +++ b/sprout/config/compiler/clang.hpp @@ -44,6 +44,10 @@ # define SPROUT_NO_CXX11_UNICODE_LITERALS #endif +#if !__has_feature(cxx_attributes) +# define SPROUT_NO_CXX11_ATTRIBUTES +#endif + #if !__has_feature(cxx_relaxed_constexpr) # define SPROUT_NO_CXX14_CONSTEXPR #endif diff --git a/sprout/config/compiler/codegear.hpp b/sprout/config/compiler/codegear.hpp index 81d5866c..67e111fb 100644 --- a/sprout/config/compiler/codegear.hpp +++ b/sprout/config/compiler/codegear.hpp @@ -17,6 +17,7 @@ #define SPROUT_NO_CXX11_USER_DEFINED_LITERALS #define SPROUT_NO_CXX11_DELEGATING_CONSTRUCTORS #define SPROUT_NO_CXX11_UNICODE_LITERALS +#define SPROUT_NO_CXX11_ATTRIBUTES #define SPROUT_NO_CXX14_CONSTEXPR #define SPROUT_NO_CXX14_VARIABLE_TEMPLATES diff --git a/sprout/config/compiler/common_edg.hpp b/sprout/config/compiler/common_edg.hpp index c4f50120..37061b51 100644 --- a/sprout/config/compiler/common_edg.hpp +++ b/sprout/config/compiler/common_edg.hpp @@ -17,6 +17,7 @@ #define SPROUT_NO_CXX11_USER_DEFINED_LITERALS #define SPROUT_NO_CXX11_DELEGATING_CONSTRUCTORS #define SPROUT_NO_CXX11_UNICODE_LITERALS +#define SPROUT_NO_CXX11_ATTRIBUTES #define SPROUT_NO_CXX14_CONSTEXPR #define SPROUT_NO_CXX14_VARIABLE_TEMPLATES diff --git a/sprout/config/compiler/digitalmars.hpp b/sprout/config/compiler/digitalmars.hpp index 5a61cb97..f09c3164 100644 --- a/sprout/config/compiler/digitalmars.hpp +++ b/sprout/config/compiler/digitalmars.hpp @@ -17,6 +17,7 @@ #define SPROUT_NO_CXX11_USER_DEFINED_LITERALS #define SPROUT_NO_CXX11_DELEGATING_CONSTRUCTORS #define SPROUT_NO_CXX11_UNICODE_LITERALS +#define SPROUT_NO_CXX11_ATTRIBUTES #define SPROUT_NO_CXX14_CONSTEXPR #define SPROUT_NO_CXX14_VARIABLE_TEMPLATES diff --git a/sprout/config/compiler/gcc.hpp b/sprout/config/compiler/gcc.hpp index 55c905a4..6399a932 100644 --- a/sprout/config/compiler/gcc.hpp +++ b/sprout/config/compiler/gcc.hpp @@ -44,6 +44,10 @@ # define SPROUT_NO_CXX11_UNICODE_LITERALS #endif +#if ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) +# define SPROUT_NO_CXX11_ATTRIBUTES +#endif + #if ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) # define SPROUT_HAS_CONSTEXPR_CMATH_FUNCTION #endif diff --git a/sprout/config/compiler/gcc_xml.hpp b/sprout/config/compiler/gcc_xml.hpp index 9b20e4bf..7dcab392 100644 --- a/sprout/config/compiler/gcc_xml.hpp +++ b/sprout/config/compiler/gcc_xml.hpp @@ -17,6 +17,7 @@ #define SPROUT_NO_CXX11_USER_DEFINED_LITERALS #define SPROUT_NO_CXX11_DELEGATING_CONSTRUCTORS #define SPROUT_NO_CXX11_UNICODE_LITERALS +#define SPROUT_NO_CXX11_ATTRIBUTES #define SPROUT_NO_CXX14_CONSTEXPR #define SPROUT_NO_CXX14_VARIABLE_TEMPLATES diff --git a/sprout/config/compiler/has_future.hpp b/sprout/config/compiler/has_future.hpp index 5860fc6c..c185a4e4 100644 --- a/sprout/config/compiler/has_future.hpp +++ b/sprout/config/compiler/has_future.hpp @@ -35,6 +35,9 @@ #ifndef SPROUT_NO_CXX11_UNICODE_LITERALS # define SPROUT_HAS_UNICODE_LITERALS #endif +#ifndef SPROUT_NO_CXX11_ATTRIBUTES +# define SPROUT_HAS_ATTRIBUTES +#endif #ifndef SPROUT_NO_CXX14_VARIABLE_TEMPLATES # define SPROUT_HAS_VARIABLE_TEMPLATES diff --git a/sprout/config/compiler/metrowerks.hpp b/sprout/config/compiler/metrowerks.hpp index c38a879b..91ce5a30 100644 --- a/sprout/config/compiler/metrowerks.hpp +++ b/sprout/config/compiler/metrowerks.hpp @@ -17,6 +17,7 @@ #define SPROUT_NO_CXX11_USER_DEFINED_LITERALS #define SPROUT_NO_CXX11_DELEGATING_CONSTRUCTORS #define SPROUT_NO_CXX11_UNICODE_LITERALS +#define SPROUT_NO_CXX11_ATTRIBUTES #define SPROUT_NO_CXX14_CONSTEXPR #define SPROUT_NO_CXX14_VARIABLE_TEMPLATES diff --git a/sprout/config/compiler/mpw.hpp b/sprout/config/compiler/mpw.hpp index 626e9004..3f2a5d9e 100644 --- a/sprout/config/compiler/mpw.hpp +++ b/sprout/config/compiler/mpw.hpp @@ -17,6 +17,7 @@ #define SPROUT_NO_CXX11_USER_DEFINED_LITERALS #define SPROUT_NO_CXX11_DELEGATING_CONSTRUCTORS #define SPROUT_NO_CXX11_UNICODE_LITERALS +#define SPROUT_NO_CXX11_ATTRIBUTES #define SPROUT_NO_CXX14_CONSTEXPR #define SPROUT_NO_CXX14_VARIABLE_TEMPLATES diff --git a/sprout/config/compiler/no_future.hpp b/sprout/config/compiler/no_future.hpp index 6eca0a03..38dac4d0 100644 --- a/sprout/config/compiler/no_future.hpp +++ b/sprout/config/compiler/no_future.hpp @@ -35,6 +35,9 @@ #ifdef SPROUT_NO_CXX11_UNICODE_LITERALS # define SPROUT_NO_UNICODE_LITERALS #endif +#ifdef SPROUT_NO_CXX11_ATTRIBUTES +# define SPROUT_NO_ATTRIBUTES +#endif #ifdef SPROUT_NO_CXX14_VARIABLE_TEMPLATES # define SPROUT_NO_VARIABLE_TEMPLATES diff --git a/sprout/config/compiler/pathscale.hpp b/sprout/config/compiler/pathscale.hpp index 424aacc8..ff342deb 100644 --- a/sprout/config/compiler/pathscale.hpp +++ b/sprout/config/compiler/pathscale.hpp @@ -18,6 +18,7 @@ # define SPROUT_NO_CXX11_USER_DEFINED_LITERALS # define SPROUT_NO_CXX11_DELEGATING_CONSTRUCTORS # define SPROUT_NO_CXX11_UNICODE_LITERALS +# define SPROUT_NO_CXX11_ATTRIBUTES # define SPROUT_NO_CXX14_CONSTEXPR # define SPROUT_NO_CXX14_VARIABLE_TEMPLATES diff --git a/sprout/config/compiler/pgi.hpp b/sprout/config/compiler/pgi.hpp index 8a542bc7..1488a32c 100644 --- a/sprout/config/compiler/pgi.hpp +++ b/sprout/config/compiler/pgi.hpp @@ -17,6 +17,7 @@ #define SPROUT_NO_CXX11_USER_DEFINED_LITERALS #define SPROUT_NO_CXX11_DELEGATING_CONSTRUCTORS #define SPROUT_NO_CXX11_UNICODE_LITERALS +#define SPROUT_NO_CXX11_ATTRIBUTES #define SPROUT_NO_CXX14_CONSTEXPR #define SPROUT_NO_CXX14_VARIABLE_TEMPLATES diff --git a/sprout/config/compiler/sunpro_cc.hpp b/sprout/config/compiler/sunpro_cc.hpp index f380a7e7..52dc4f5d 100644 --- a/sprout/config/compiler/sunpro_cc.hpp +++ b/sprout/config/compiler/sunpro_cc.hpp @@ -17,6 +17,7 @@ #define SPROUT_NO_CXX11_USER_DEFINED_LITERALS #define SPROUT_NO_CXX11_DELEGATING_CONSTRUCTORS #define SPROUT_NO_CXX11_UNICODE_LITERALS +#define SPROUT_NO_CXX11_ATTRIBUTES #define SPROUT_NO_CXX14_CONSTEXPR #define SPROUT_NO_CXX14_VARIABLE_TEMPLATES diff --git a/sprout/config/compiler/vacpp.hpp b/sprout/config/compiler/vacpp.hpp index 6f2543c4..0086c49c 100644 --- a/sprout/config/compiler/vacpp.hpp +++ b/sprout/config/compiler/vacpp.hpp @@ -21,6 +21,7 @@ #define SPROUT_NO_CXX11_USER_DEFINED_LITERALS #define SPROUT_NO_CXX11_DELEGATING_CONSTRUCTORS #define SPROUT_NO_CXX11_UNICODE_LITERALS +#define SPROUT_NO_CXX11_ATTRIBUTES #define SPROUT_NO_CXX14_CONSTEXPR #define SPROUT_NO_CXX14_VARIABLE_TEMPLATES diff --git a/sprout/config/compiler/visualc.hpp b/sprout/config/compiler/visualc.hpp index 74b56169..127a2b44 100644 --- a/sprout/config/compiler/visualc.hpp +++ b/sprout/config/compiler/visualc.hpp @@ -19,6 +19,7 @@ #define SPROUT_NO_CXX11_USER_DEFINED_LITERALS #define SPROUT_NO_CXX11_DELEGATING_CONSTRUCTORS #define SPROUT_NO_CXX11_UNICODE_LITERALS +#define SPROUT_NO_CXX11_ATTRIBUTES #define SPROUT_NO_CXX14_CONSTEXPR #define SPROUT_NO_CXX14_VARIABLE_TEMPLATES diff --git a/sprout/config/suffix.hpp b/sprout/config/suffix.hpp index cae0ee35..630e5779 100644 --- a/sprout/config/suffix.hpp +++ b/sprout/config/suffix.hpp @@ -75,6 +75,17 @@ # define SPROUT_DELETED_FUNCTION_DECL ; #endif // #ifndef SPROUT_CONFIG_DISABLE_DELETED_FUNCTIONS +// +// SPROUT_DEPRECATED +// +#if defined(__GNUC__) || defined(__clang__) +# define SPROUT_DEPRECATED __attribute__((deprecated)) +#elif defined(_MSC_VER) +# define SPROUT_DEPRECATED) __declspec(deprecated) +#else +# define SPROUT_DEPRECATED +#endif + // // SPROUT_USE_EXPLICIT_CONVERSION_OPERATORS // SPROUT_EXPLICIT_CONVERSION diff --git a/sprout/string/to_string_array.hpp b/sprout/string/to_string_array.hpp index a64a1871..f0e77125 100644 --- a/sprout/string/to_string_array.hpp +++ b/sprout/string/to_string_array.hpp @@ -16,8 +16,10 @@ namespace sprout { // // to_string_array + // [[deprecated]] // template + SPROUT_DEPRECATED inline SPROUT_CONSTEXPR sprout::array to_string_array(Types&&... args) { return sprout::convert_array(sprout::to_string_value(), sprout::forward(args)...); diff --git a/sprout/string/to_string_value.hpp b/sprout/string/to_string_value.hpp index 833ac365..1d83cfa3 100644 --- a/sprout/string/to_string_value.hpp +++ b/sprout/string/to_string_value.hpp @@ -16,8 +16,9 @@ namespace sprout { // // to_string_value + // [[deprecated]] // - struct to_string_value { + struct SPROUT_DEPRECATED to_string_value { public: template SPROUT_CONSTEXPR decltype(sprout::to_string(std::declval()))