diff options
author | Bruno Haible <bruno@clisp.org> | 2006-11-27 12:36:42 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-06-23 12:14:23 +0200 |
commit | 63eb88048e86ec314d1b02a2c45e87ab4b699afe (patch) | |
tree | 557a310b0cdbafd5fec02f450f2f6201b335850a /gnulib-local | |
parent | e22473f2d976321cfd4be0af6d2ca644bec70f97 (diff) | |
download | external_gettext-63eb88048e86ec314d1b02a2c45e87ab4b699afe.zip external_gettext-63eb88048e86ec314d1b02a2c45e87ab4b699afe.tar.gz external_gettext-63eb88048e86ec314d1b02a2c45e87ab4b699afe.tar.bz2 |
Add operator==.
Diffstat (limited to 'gnulib-local')
-rw-r--r-- | gnulib-local/ChangeLog | 5 | ||||
-rwxr-xr-x | gnulib-local/build-aux/moopp | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/gnulib-local/ChangeLog b/gnulib-local/ChangeLog index bf1bc46..02450cd 100644 --- a/gnulib-local/ChangeLog +++ b/gnulib-local/ChangeLog @@ -1,3 +1,8 @@ +2006-11-26 Bruno Haible <bruno@clisp.org> + + * build-aux/moopp: In the C++ class definition, add 'operator ==', + 'operator !=' members, and add constructors for downcasting. + 2006-11-25 Bruno Haible <bruno@clisp.org> * lib/glibconfig_.h (g_return_if_fail, g_return_val_if_fail, diff --git a/gnulib-local/build-aux/moopp b/gnulib-local/build-aux/moopp index 4093c57..4fa4455 100755 --- a/gnulib-local/build-aux/moopp +++ b/gnulib-local/build-aux/moopp @@ -368,6 +368,9 @@ func_start_creation "$newfile" done # The 'operator void *' is needed to avoid ambiguous conversion chains. echo " operator void * () { return _pointer; }" + # The 'operator ==' and 'operator !=' are needed to avoid ambiguous comparisons with NULL. + echo " bool operator == (const void *p) { return _pointer == p; }" + echo " bool operator != (const void *p) { return _pointer != p; }" atroot=yes for classname in $all_superclasses; do if test -n "$atroot"; then @@ -375,7 +378,9 @@ func_start_creation "$newfile" else repclassalias="${classname}_representation" fi - echo " operator ${classname}_t () { return (${classname}_t) ($struct ${repclassalias} *) _pointer; }" + echo " operator ${classname}_t () { return (${classname}_t) (struct ${repclassalias} *) _pointer; }" + # The 'explicit' constructors allow to downcast. + echo " explicit ${main_classname}_t (${classname}_t x) : _pointer ((struct ${main_repclassalias} *) (void *) x) {}" atroot= done echo "};" |