Changeset 2386:81b47fc5c444 in lemon-0.x for lemon/bits/variant.h
- Timestamp:
- 03/02/07 19:04:28 (17 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3217
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/bits/variant.h
r2292 r2386 74 74 /// This constructor initalizes to the given value of the \c First 75 75 /// type. 76 BiVariant(const First& f irst) {76 BiVariant(const First& f) { 77 77 flag = true; 78 new(reinterpret_cast<First*>(data)) First(f irst);78 new(reinterpret_cast<First*>(data)) First(f); 79 79 } 80 80 … … 83 83 /// This constructor initalizes to the given value of the \c 84 84 /// Second type. 85 BiVariant(const Second& s econd) {85 BiVariant(const Second& s) { 86 86 flag = false; 87 new(reinterpret_cast<Second*>(data)) Second(s econd);87 new(reinterpret_cast<Second*>(data)) Second(s); 88 88 } 89 89 … … 122 122 /// This function sets the variant to the given value of the \c 123 123 /// First type. 124 BiVariant& setFirst(const First& f irst) {124 BiVariant& setFirst(const First& f) { 125 125 destroy(); 126 126 flag = true; 127 new(reinterpret_cast<First*>(data)) First(f irst);127 new(reinterpret_cast<First*>(data)) First(f); 128 128 return *this; 129 129 } … … 144 144 /// This function sets the variant to the given value of the \c 145 145 /// Second type. 146 BiVariant& setSecond(const Second& s econd) {146 BiVariant& setSecond(const Second& s) { 147 147 destroy(); 148 148 flag = false; 149 new(reinterpret_cast<Second*>(data)) Second(s econd);149 new(reinterpret_cast<Second*>(data)) Second(s); 150 150 return *this; 151 151 } 152 152 153 153 /// \brief Operator form of the \c setFirst() 154 BiVariant& operator=(const First& f irst) {155 return setFirst(f irst);154 BiVariant& operator=(const First& f) { 155 return setFirst(f); 156 156 } 157 157 158 158 /// \brief Operator form of the \c setSecond() 159 BiVariant& operator=(const Second& s econd) {160 return setSecond(s econd);159 BiVariant& operator=(const Second& s) { 160 return setSecond(s); 161 161 } 162 162
Note: See TracChangeset
for help on using the changeset viewer.