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
=== modified file 'src/util/stl_util.h'
--- src/util/stl_util.h 2011-08-27 14:57:52 +0000
+++ src/util/stl_util.h 2011-10-11 18:03:26 +0000
@@ -198,26 +198,6 @@
198198
199///////////////////////////////////////////////////////////////////////////////199///////////////////////////////////////////////////////////////////////////////
200200
201template<typename T>
202struct is_double {
203 static bool const value = false;
204};
205
206template<>
207struct is_double<double> {
208 static bool const value = true;
209};
210
211template<typename T>
212struct is_float {
213 static bool const value = false;
214};
215
216template<>
217struct is_float<float> {
218 static bool const value = true;
219};
220
221template<typename NumericType> inline201template<typename NumericType> inline
222typename std::enable_if<ZORBA_TR1_NS::is_signed<NumericType>::value,bool>::type202typename std::enable_if<ZORBA_TR1_NS::is_signed<NumericType>::value,bool>::type
223ge0( NumericType n ) {203ge0( NumericType n ) {
224204
=== modified file 'src/util/string_util.h'
--- src/util/string_util.h 2011-08-23 13:49:38 +0000
+++ src/util/string_util.h 2011-10-11 18:03:26 +0000
@@ -510,7 +510,8 @@
510 * @throws range_error if the number overflows/underflows.510 * @throws range_error if the number overflows/underflows.
511 */511 */
512template<typename NumericType> inline512template<typename NumericType> inline
513typename std::enable_if<is_double<NumericType>::value,NumericType>::type513typename std::enable_if<ZORBA_TR1_NS::is_same<NumericType,double>::value,
514 NumericType>::type
514aton( char const *s ) {515aton( char const *s ) {
515 return atod( s );516 return atod( s );
516}517}
@@ -527,7 +528,8 @@
527 * @throws range_error if the number overflows/underflows.528 * @throws range_error if the number overflows/underflows.
528 */529 */
529template<typename NumericType> inline530template<typename NumericType> inline
530typename std::enable_if<is_float<NumericType>::value,NumericType>::type531typename std::enable_if<ZORBA_TR1_NS::is_same<NumericType,float>::value,
532 NumericType>::type
531aton( char const *s ) {533aton( char const *s ) {
532 return atof( s );534 return atof( s );
533}535}

Subscribers

People subscribed via source and target branches