Merge lp:~paul-lucas/zorba/bug-872401 into lp:zorba

Proposed by Paul J. Lucas
Status: Merged
Approved by: Matthias Brantner
Approved revision: 10507
Merged at revision: 10507
Proposed branch: lp:~paul-lucas/zorba/bug-872401
Merge into: lp:zorba
Diff against target: 54 lines (+4/-22)
2 files modified
src/util/stl_util.h (+0/-20)
src/util/string_util.h (+4/-2)
To merge this branch: bzr merge lp:~paul-lucas/zorba/bug-872401
Reviewer Review Type Date Requested Status
Paul J. Lucas Approve
Matthias Brantner Approve
Review via email: mp+79014@code.launchpad.net

Commit message

Replaced is_double and is_float by is_same.

Description of the change

Replaced is_double and is_float by is_same.

To post a comment you must log in.
Revision history for this message
Matthias Brantner (matthias-brantner) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Paul J. Lucas (paul-lucas) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug-872401-2011-10-11T19-31-01.318Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/util/stl_util.h'
2--- src/util/stl_util.h 2011-08-27 14:57:52 +0000
3+++ src/util/stl_util.h 2011-10-11 18:03:26 +0000
4@@ -198,26 +198,6 @@
5
6 ///////////////////////////////////////////////////////////////////////////////
7
8-template<typename T>
9-struct is_double {
10- static bool const value = false;
11-};
12-
13-template<>
14-struct is_double<double> {
15- static bool const value = true;
16-};
17-
18-template<typename T>
19-struct is_float {
20- static bool const value = false;
21-};
22-
23-template<>
24-struct is_float<float> {
25- static bool const value = true;
26-};
27-
28 template<typename NumericType> inline
29 typename std::enable_if<ZORBA_TR1_NS::is_signed<NumericType>::value,bool>::type
30 ge0( NumericType n ) {
31
32=== modified file 'src/util/string_util.h'
33--- src/util/string_util.h 2011-08-23 13:49:38 +0000
34+++ src/util/string_util.h 2011-10-11 18:03:26 +0000
35@@ -510,7 +510,8 @@
36 * @throws range_error if the number overflows/underflows.
37 */
38 template<typename NumericType> inline
39-typename std::enable_if<is_double<NumericType>::value,NumericType>::type
40+typename std::enable_if<ZORBA_TR1_NS::is_same<NumericType,double>::value,
41+ NumericType>::type
42 aton( char const *s ) {
43 return atod( s );
44 }
45@@ -527,7 +528,8 @@
46 * @throws range_error if the number overflows/underflows.
47 */
48 template<typename NumericType> inline
49-typename std::enable_if<is_float<NumericType>::value,NumericType>::type
50+typename std::enable_if<ZORBA_TR1_NS::is_same<NumericType,float>::value,
51+ NumericType>::type
52 aton( char const *s ) {
53 return atof( s );
54 }

Subscribers

People subscribed via source and target branches