diff options
| author | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-05-21 01:12:00 +0000 |
|---|---|---|
| committer | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-05-21 01:12:00 +0000 |
| commit | a96ae95b708ffd50cb89a386c5962c948dcc708b (patch) | |
| tree | c56e29414015d8d362048f2600dec8925fe585b3 /libstdc++-v3/include/std/system_error | |
| parent | 8750ee6ec744f0a8987ecbea7f7c6693a72e8fca (diff) | |
| download | ppe42-gcc-a96ae95b708ffd50cb89a386c5962c948dcc708b.tar.gz ppe42-gcc-a96ae95b708ffd50cb89a386c5962c948dcc708b.zip | |
2009-05-20 Benjamin Kosnik <bkoz@redhat.com>
* include/tr1_impl/functional (function): Use explicit operator bool.
* include/bits/shared_ptr.h (__shared_ptr): Same.
* include/bits/unique_ptr.h (unique_ptr): Same.
* include/std/mutex (unique_lock): Same.
* include/std/system_error (error_code): Same.
(error_condition): Same.
* include/std/ostream (sentry): Same.
* include/std/istream (sentry): Same.
* testsuite/19_diagnostics/error_condition/operators/bool.cc: Adjust.
* testsuite/19_diagnostics/error_condition/operators/bool_neg.cc: Same.
* testsuite/19_diagnostics/error_code/operators/bool.cc: Same.
* testsuite/19_diagnostics/error_code/operators/bool_neg.cc: Same.
* testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: Same.
* testsuite/20_util/unique_ptr/assign/assign_neg.cc: Same.
* testsuite/20_util/shared_ptr/observers/bool_conv.cc: Same.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147756 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/std/system_error')
| -rw-r--r-- | libstdc++-v3/include/std/system_error | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/libstdc++-v3/include/std/system_error b/libstdc++-v3/include/std/system_error index b9902a137c1..7f462a20dff 100644 --- a/libstdc++-v3/include/std/system_error +++ b/libstdc++-v3/include/std/system_error @@ -152,15 +152,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) message() const { return category().message(value()); } - // Safe bool idiom. - // explicit operator bool() const throw() - // { return _M_value != 0; } - typedef void (*__bool_type)(); - - static void __not_bool_type() { } - - operator __bool_type() const - { return _M_value != 0 ? &__not_bool_type : false; } + explicit operator bool() const + { return _M_value != 0 ? true : false; } // DR 804. private: @@ -233,15 +226,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std) message() const { return category().message(value()); } - // Safe bool idiom. - // explicit operator bool() const throw() - // { return _M_value != 0; } - typedef void (*__bool_type)(); - - static void __not_bool_type() { } - - operator __bool_type() const - { return _M_value != 0 ? &__not_bool_type : false; } + explicit operator bool() const + { return _M_value != 0 ? true : false; } // DR 804. private: |

