Opened 12 years ago

Closed 10 years ago

#4706 closed Bugs (fixed)

ValueType requirements seem wrong

Reported by: Dave Abrahams Owned by: nasonov
Milestone: To Be Determined Component: any
Version: Boost 1.44.0 Severity: Problem
Keywords: Cc:

Description (last modified by Dave Abrahams)

According to the doc:

The specific requirements on value types to be used in an any are:

A ValueType is CopyConstructible [20.1.3].

A ValueType is optionally Assignable [23.1]. The strong exception-safety guarantee is required for all forms of assignment.

The destructor for a ValueType upholds the no-throw exception-safety guarantee.

The doc seems to be saying that Assignable is not strictly required, but if you supply an assignment operator, it must offer the strong guarantee. But nothing in any depends on assignability of its ValueType parameter, much less that it provides the strong guarantee.

Change History (3)

comment:1 by Dave Abrahams, 12 years ago

Description: modified (diff)

comment:2 by Steven Watanabe, 10 years ago

I agree. This is a spurious requirement.

comment:3 by Steven Watanabe, 10 years ago

Resolution: fixed
Status: newclosed

(In [80980]) Remove spurious requirement. Fixes #4706.

Note: See TracTickets for help on using tickets.