Skip to content

Commit d6330b7

Browse files
committed
Remove base class numpunct_base
No longer required as supported char types can be asserted now. Also avoids confusion which one a user should use.
1 parent e19e1d9 commit d6330b7

File tree

1 file changed

+5
-28
lines changed

1 file changed

+5
-28
lines changed

include/boost/locale/numpunct.hpp

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#define BOOST_LOCALE_NUMPUNCT_HPP_INCLUDED
1212

1313
#include <boost/locale/config.hpp>
14+
#include <boost/locale/detail/is_supported_char.hpp>
1415
#include <locale>
1516
#include <string>
1617

@@ -29,11 +30,13 @@ namespace boost { namespace locale {
2930
/// - Some backends may provide single char replacements of the encoded separators instead of falling back to the
3031
/// "C" locale.
3132
template<typename CharType>
32-
class numpunct_base : public std::numpunct<CharType> {
33+
class numpunct : public std::numpunct<CharType> {
34+
BOOST_LOCALE_ASSERT_IS_SUPPORTED(CharType);
35+
3336
public:
3437
using string_type = std::numpunct<CharType>::string_type;
3538

36-
numpunct_base(size_t refs = 0) : std::numpunct<CharType>(refs) {}
39+
numpunct(size_t refs = 0) : std::numpunct<CharType>(refs) {}
3740

3841
/// Provides the character to use as decimal point possibly encoded into multiple code units
3942
string_type decimal_point_str() const { return do_decimal_point_str(); }
@@ -79,32 +82,6 @@ namespace boost { namespace locale {
7982
return string_type(t, t + sizeof(t) - 1);
8083
}
8184
};
82-
83-
template<typename CharType>
84-
struct numpunct;
85-
86-
template<>
87-
struct numpunct<char> : numpunct_base<char> {
88-
numpunct(size_t refs = 0) : numpunct_base<char>(refs) {}
89-
};
90-
91-
template<>
92-
struct numpunct<wchar_t> : numpunct_base<wchar_t> {
93-
numpunct(size_t refs = 0) : numpunct_base<wchar_t>(refs) {}
94-
};
95-
96-
#ifdef BOOST_LOCALE_ENABLE_CHAR16_T
97-
template<>
98-
struct numpunct<char16_t> : numpunct_base<char16_t> {
99-
numpunct(size_t refs = 0) : numpunct_base<char16_t>(refs) {}
100-
};
101-
#endif
102-
#ifdef BOOST_LOCALE_ENABLE_CHAR32_T
103-
template<>
104-
struct numpunct<char32_t> : numpunct_base<char32_t> {
105-
numpunct(size_t refs = 0) : numpunct_base<char32_t>(refs) {}
106-
};
107-
#endif
10885
}} // namespace boost::locale
10986

11087
#endif

0 commit comments

Comments
 (0)