Opened 6 years ago

Closed 6 years ago

#12329 closed Bugs (wontfix)

typedef argument_type missing on optional<T&>

Reported by: Daniel Laügt <daniel.laugt@…> Owned by: Fernando Cacciola
Milestone: To Be Determined Component: optional
Version: Boost 1.61.0 Severity: Regression
Keywords: Cc:

Description

Hi,

Any reason why typedef argument_type has been removed in the new specialization of optional<T&>?

To have the same typedefs between optional<T> and optional<T&>, it would be nice to add the following in the specialization of optional<T&>:
typedef T& argument_type;

This allows also to keep compatibility on public interface of the old optional implementation, except of course if there is a good reason to have removing this typedef...

Regards,
Daniel.

Change History (3)

comment:1 by akrzemi1, 6 years ago

there is a typedef value_type that already does this. Can you use value_type instead?

comment:2 by Daniel Laügt <daniel.laugt@…>, 6 years ago

reference_type, reference_const_type, rval_reference_type typedefs also already do this. This was just for using a unique typedef argument_type to have:

  • T const& for optional<T>
  • T& for optional<T&>

But now, I see that I can use the typedef reference_const_type instead for this purpose. For optional<T>, it seems that reference_const_type and argument_type are redundant.

Anyway, this ticket was just a nice to have... It can be closed.

comment:3 by akrzemi1, 6 years ago

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.