summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8d10164)
raw | patch | inline | side by side (parent: 8d10164)
author | mental <mental@users.sourceforge.net> | |
Mon, 5 Mar 2007 06:07:39 +0000 (06:07 +0000) | ||
committer | mental <mental@users.sourceforge.net> | |
Mon, 5 Mar 2007 06:07:39 +0000 (06:07 +0000) |
src/libnr/nr-maybe.h | patch | blob | history |
diff --git a/src/libnr/nr-maybe.h b/src/libnr/nr-maybe.h
index 679cd9d572beede4a1eeb7fd8beaecb2b3e69fc8..6749dfc0123bc0ba7d391b0604f33e8e3ff0c343 100644 (file)
--- a/src/libnr/nr-maybe.h
+++ b/src/libnr/nr-maybe.h
public:
Maybe(Nothing) : _is_nothing(true) {}
Maybe(T const &t) : _t(t), _is_nothing(false) {}
- Maybe(Maybe const &m) : _t(*m._t), _is_nothing(m._is_nothing) {}
+ Maybe(Maybe const &m) : _t(m._t), _is_nothing(m._is_nothing) {}
template <typename T2> Maybe(Maybe<T2> const &m)
: _is_nothing(!m)
Maybe(Maybe const &m) : _ref(m._ref) {}
template <typename T2> Maybe(Maybe<T2> const &m)
- : _ref( m ? *m : NULL ) {}
+ : _ref( m ? &*m : NULL ) {}
template <typename T2> Maybe(T2 &t) : _ref(&t) {}
operator bool() const { return _ref; }
template <typename T2>
bool operator!=(NR::Maybe<T2> const &other) const {
if ( !_ref || !other ) {
- return _ref || _other;
+ return _ref || other;
} else {
return *_ref != *other;
}