@@ -63,41 +63,41 @@ namespace YY
63
63
Reset ();
64
64
}
65
65
66
- inline bool HasValue () const
66
+ inline bool __YYAPI HasValue () const noexcept
67
67
{
68
68
return bHasValue;
69
69
}
70
70
71
- _Type* GetValuePtr ()
71
+ _Ret_maybenull_ _Type* __YYAPI GetValuePtr () noexcept
72
72
{
73
73
return bHasValue ? &oValue : nullptr ;
74
74
}
75
75
76
- inline const _Type* GetValuePtr () const
76
+ _Ret_maybenull_ inline const _Type* __YYAPI GetValuePtr () const noexcept
77
77
{
78
78
return const_cast <Optional*>(this )->GetValuePtr ();
79
79
}
80
80
81
- inline _Type& GetValue ()
81
+ inline _Type& __YYAPI GetValue ()
82
82
{
83
83
return *GetValuePtr ();
84
84
}
85
85
86
- inline const _Type& GetValue () const
86
+ inline const _Type& __YYAPI GetValue () const
87
87
{
88
88
return *GetValuePtr ();
89
89
}
90
90
91
91
template <typename ... Args>
92
- _Type& Emplace (Args&&... oArgs)
92
+ _Type& __YYAPI Emplace (Args&&... oArgs)
93
93
{
94
94
Reset ();
95
95
new (&oValue) _Type (std::forward<Args>(oArgs)...);
96
96
bHasValue = true ;
97
97
return oValue;
98
98
}
99
99
100
- void Reset ()
100
+ void __YYAPI Reset ()
101
101
{
102
102
if (bHasValue)
103
103
{
@@ -106,7 +106,7 @@ namespace YY
106
106
}
107
107
}
108
108
109
- Optional& operator =(const _Type& _oValue)
109
+ Optional& __YYAPI operator =(const _Type& _oValue)
110
110
{
111
111
if (bHasValue)
112
112
{
@@ -124,7 +124,7 @@ namespace YY
124
124
return *this ;
125
125
}
126
126
127
- Optional& operator =(_Type&& _oValue)
127
+ Optional& __YYAPI operator =(_Type&& _oValue)
128
128
{
129
129
if (bHasValue)
130
130
{
@@ -142,7 +142,7 @@ namespace YY
142
142
return *this ;
143
143
}
144
144
145
- Optional& operator =(const Optional& _oOther)
145
+ Optional& __YYAPI operator =(const Optional& _oOther)
146
146
{
147
147
if (_oOther.HasValue ())
148
148
{
@@ -156,7 +156,7 @@ namespace YY
156
156
return *this ;
157
157
}
158
158
159
- Optional& operator =(Optional&& _oOther)
159
+ Optional& __YYAPI operator =(Optional&& _oOther)
160
160
{
161
161
if (this == &_oOther)
162
162
return *this ;
@@ -174,7 +174,7 @@ namespace YY
174
174
return *this ;
175
175
}
176
176
177
- bool operator ==(const Optional& _oOther) const
177
+ bool __YYAPI operator ==(const Optional& _oOther) const noexcept
178
178
{
179
179
if (HasValue () != _oOther.HasValue ())
180
180
return false ;
@@ -188,7 +188,7 @@ namespace YY
188
188
}
189
189
190
190
#if !defined(_HAS_CXX20) || _HAS_CXX20 == 0
191
- bool operator !=(const Optional& _oOther) const
191
+ bool __YYAPI operator !=(const Optional& _oOther) const noexcept
192
192
{
193
193
if (HasValue () != _oOther.HasValue ())
194
194
return true ;
0 commit comments