Skip to content

Commit d033f1e

Browse files
committed
fixes
1 parent 0bddea8 commit d033f1e

File tree

5 files changed

+19
-27
lines changed

5 files changed

+19
-27
lines changed

include/boost/locale/numpunct.hpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,19 @@
99
#ifndef BOOST_LOCALE_NUMPUNCT_HPP_INCLUDED
1010
#define BOOST_LOCALE_NUMPUNCT_HPP_INCLUDED
1111
#include <boost/locale/config.hpp>
12-
#ifdef BOOST_MSVC
13-
# pragma warning(push)
14-
# pragma warning(disable : 4275 4251 4231 4660)
15-
#endif
1612
#include <locale>
1713
#include <string>
1814

1915
namespace boost {
2016
namespace locale {
2117

2218
template<typename CharType>
23-
class BOOST_LOCALE_DECL numpunct_base : public std::numpunct<CharType>
19+
class numpunct_base : public std::numpunct<CharType>
2420
{
2521
typedef std::basic_string<CharType> string_type;
2622
public:
2723
numpunct_base(size_t refs = 0) : std::numpunct<CharType>(refs) {}
24+
virtual ~numpunct_base();
2825

2926
string_type decimal_point_str() const {
3027
return do_decimal_point_str();
@@ -35,7 +32,7 @@ namespace boost {
3532
}
3633

3734
protected:
38-
virtual CharType do_decimal_point() const {
35+
CharType do_decimal_point() const BOOST_OVERRIDE {
3936
string_type dec = do_decimal_point_str();
4037
if (dec.size() > 1) {
4138
return '.';
@@ -49,7 +46,7 @@ namespace boost {
4946
return string_type(t, t + sizeof(t) - 1);
5047
}
5148

52-
virtual CharType do_thousands_sep() const {
49+
CharType do_thousands_sep() const BOOST_OVERRIDE {
5350
string_type thous = do_thousands_sep_str();
5451
if (thous.size() > 1) {
5552
return ',';
@@ -63,18 +60,18 @@ namespace boost {
6360
return string_type(t, t + sizeof(t) - 1);
6461
}
6562

66-
virtual string_type do_truename() const {
63+
virtual string_type do_truename() const BOOST_OVERRIDE {
6764
static const char t[] = "true";
6865
return string_type(t, t + sizeof(t) - 1);
6966
}
7067

71-
virtual string_type do_falsename() const {
68+
virtual string_type do_falsename() const BOOST_OVERRIDE {
7269
static const char t[] = "false";
7370
return string_type(t, t + sizeof(t) - 1);
7471
}
7572
};
7673

77-
template<typename CharType> struct numpunct {};
74+
template<typename CharType> struct numpunct;
7875

7976
template<> struct numpunct<char> : numpunct_base<char> {
8077
numpunct (size_t refs = 0) : numpunct_base<char>(refs) {}

src/boost/locale/icu/numeric.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,13 +381,13 @@ struct icu_numpunct : public numpunct<CharType> {
381381
}
382382
}
383383
protected:
384-
virtual string_type do_decimal_point_str() const {
384+
string_type do_decimal_point_str() const BOOST_OVERRIDE {
385385
return decimal_point_;
386386
}
387-
virtual string_type do_thousands_sep_str() const {
387+
string_type do_thousands_sep_str() const BOOST_OVERRIDE {
388388
return thousands_sep_;
389389
}
390-
virtual std::string do_grouping() const {
390+
std::string do_grouping() const BOOST_OVERRIDE {
391391
return grouping_;
392392
}
393393

src/boost/locale/posix/numeric.cpp

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -423,28 +423,18 @@ class num_punct_posix : public numpunct<CharType> {
423423
{
424424
s2=conv::to_utf<wchar_t>(s1,nl_langinfo_l(CODESET,lc));
425425
}
426-
virtual string_type do_decimal_point_str() const
426+
string_type do_decimal_point_str() const BOOST_OVERRIDE
427427
{
428428
return decimal_point_;
429429
}
430-
virtual string_type do_thousands_sep_str() const
430+
string_type do_thousands_sep_str() const BOOST_OVERRIDE
431431
{
432432
return thousands_sep_;
433433
}
434434
std::string do_grouping() const BOOST_OVERRIDE
435435
{
436436
return grouping_;
437437
}
438-
string_type do_truename() const BOOST_OVERRIDE
439-
{
440-
static const char t[]="true";
441-
return string_type(t,t+sizeof(t)-1);
442-
}
443-
string_type do_falsename() const BOOST_OVERRIDE
444-
{
445-
static const char t[]="false";
446-
return string_type(t,t+sizeof(t)-1);
447-
}
448438
private:
449439
string_type decimal_point_;
450440
string_type thousands_sep_;

src/boost/locale/shared/ids.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <boost/locale/date_time_facet.hpp>
1212
#include <boost/locale/info.hpp>
1313
#include <boost/locale/message.hpp>
14+
#include <boost/locale/numpunct.hpp>
1415

1516
#include <boost/core/ignore_unused.hpp>
1617

@@ -25,16 +26,19 @@ namespace boost {
2526
std::locale::id converter<char>::id;
2627
converter<char>::~converter() {}
2728
std::locale::id base_message_format<char>::id;
29+
numpunct_base<char>::~numpunct_base() {}
2830

2931
std::locale::id converter<wchar_t>::id;
3032
converter<wchar_t>::~converter() {}
3133
std::locale::id base_message_format<wchar_t>::id;
34+
numpunct_base<wchar_t>::~numpunct_base() {}
3235

3336
#ifdef BOOST_LOCALE_ENABLE_CHAR16_T
3437

3538
std::locale::id converter<char16_t>::id;
3639
converter<char16_t>::~converter() {}
3740
std::locale::id base_message_format<char16_t>::id;
41+
numpunct_base<char16_t>::~numpunct_base() {}
3842

3943
#endif
4044

@@ -43,6 +47,7 @@ namespace boost {
4347
std::locale::id converter<char32_t>::id;
4448
converter<char32_t>::~converter() {}
4549
std::locale::id base_message_format<char32_t>::id;
50+
numpunct_base<char32_t>::~numpunct_base() {}
4651

4752
#endif
4853

src/boost/locale/win32/numeric.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,11 @@ BOOST_LOCALE_END_CONST_CONDITION
141141
{
142142
s2=conv::from_utf(s1,"UTF-8");
143143
}
144-
virtual string_type do_decimal_point_str() const
144+
string_type do_decimal_point_str() const BOOST_OVERRIDE
145145
{
146146
return decimal_point_;
147147
}
148-
virtual string_type do_thousands_sep_str() const
148+
string_type do_thousands_sep_str() const BOOST_OVERRIDE
149149
{
150150
return thousands_sep_;
151151
}

0 commit comments

Comments
 (0)