Opened 14 years ago

Closed 12 years ago

#2159 closed Feature Requests (wontfix)

release()

Reported by: anonymous Owned by: Fernando Cacciola
Milestone: Boost 1.36.0 Component: optional
Version: Boost 1.35.0 Severity: Optimization
Keywords: Cc:

Description

I propose the addition of a new function to the boost::optional class.

T & release()

This function should reset() the internal value, and return it. It should throw if the optional does not contain any internal T.

Change History (2)

comment:1 by Steven Watanabe, 13 years ago

This should be closed as wontfix.

  • It is impossible to return a reference to a value that has been destroyed.
  • This functionality can be implemented on top of the current interface.
  • Throwing an exception is inconsistent with the rest of boost::optional's interface.

comment:2 by anonymous, 12 years ago

Resolution: wontfix
Status: newclosed

Wontfix. As it is impossible to implement requested functionality.

Note: See TracTickets for help on using tickets.