|
|
От: |
Oleg A. Bachin
|
|
| Дата: | 09.08.04 14:55 | ||
| Оценка: | |||
G>template <typename T>
G>class nullable
G>{
G>public:
G> bool operator == (const T &other) const // 1*
G> {
G> if (this.is_null || other.is_null) // 2*
G> throw std::logic_error("null_value_compare");
G> return m_Value == T // 3*
G> }
G> const T & value() const
{
return value_;
} template <typename T>
bool operator==(nullable<T> const& other)
{
if (this->is_null() || other.is_null())
throw null_value_compare("null_value_compare");
return (this->value_ == other.value());
}error C3767: '==' matching function is not accessible