Created on 2009-10-08.00:00:00 last changed 171 months ago
Proposed resolution:
Change [syserr.errcode.overview] and [syserr.errcode.modifiers]:
template <class ErrorCodeEnum> typename enable_if<is_error_code_enum<ErrorCodeEnum>::value, error_code&>::type&operator=(ErrorCodeEnum e);
Change [syserr.errcondition.overview]:
template<typenameclass ErrorConditionEnum> typename enable_if<is_error_condition_enum<ErrorConditionEnum>::value, error_conditionde&>::type&operator=( ErrorConditionEnum e );
Change [syserr.errcondition.modifiers]:
template <class ErrorConditionEnum> typename enable_if<is_error_condition_enum<ErrorConditionEnum>::value, error_condition&>::type&operator=(ErrorConditionEnum e);Postcondition: *this == make_error_condition(e).
Returns: *this.
Throws: Nothing.
[ 2009-10 Santa Cruz: ]
NADResolved, solved by 1237.
[ 2009-10-18 Beman adds: ]
The proposed resolution for issue 1237 makes this issue moot, so it should become NAD.
N2960 [syserr.errcode.overview] and [syserr.errcode.modifiers] say:
template <class ErrorCodeEnum> typename enable_if<is_error_code_enum<ErrorCodeEnum>::value>::type& operator=(ErrorCodeEnum e);
They should say:
template <class ErrorCodeEnum> typename enable_if<is_error_code_enum<ErrorCodeEnum>::value, error_code>::type& operator=(ErrorCodeEnum e);
Or (I prefer this form):
template <class ErrorCodeEnum> typename enable_if<is_error_code_enum<ErrorCodeEnum>::value, error_code&>::type operator=(ErrorCodeEnum e);
This is because enable_if is declared as ([meta.trans.other]):
template <bool B, class T = void> struct enable_if;
So, the current wording makes operator= return void&, which is not good.
[syserr.errcode.modifiers]/4 says
Returns: *this.
which is correct.
Additionally,
[syserr.errcondition.overview]/1 says:
template<typename ErrorConditionEnum> typename enable_if<is_error_condition_enum<ErrorConditionEnum>, error_code>::type & operator=( ErrorConditionEnum e );
Which contains several problems (typename versus class inconsistency, lack of ::value, error_code instead of error_condition), while [syserr.errcondition.modifiers] says:
template <class ErrorConditionEnum> typename enable_if<is_error_condition_enum<ErrorConditionEnum>::value>::type& operator=(ErrorConditionEnum e);
Which returns void&. They should both say:
template <class ErrorConditionEnum> typename enable_if<is_error_condition_enum<ErrorConditionEnum>::value, error_condition>::type& operator=(ErrorConditionEnum e);
Or (again, I prefer this form):
template <class ErrorConditionEnum> typename enable_if<is_error_condition_enum<ErrorConditionEnum>::value, error_condition&>::type operator=(ErrorConditionEnum e);
Additionally, [syserr.errcondition.modifiers] lacks a "Returns: *this." paragraph, which is presumably necessary.
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-12-05 00:09:22 | admin | set | status: nad -> resolved |
2010-10-21 18:28:33 | admin | set | messages: + msg1239 |
2010-10-21 18:28:33 | admin | set | messages: + msg1238 |
2010-10-21 18:28:33 | admin | set | messages: + msg1237 |
2009-10-08 00:00:00 | admin | create |