Modify

Opened 5 years ago

Last modified 4 years ago

#8442 new Feature Requests

Match std::reference_wrapper functionality

Reported by: Nathan Crookston <nathan.crookston+boost@…> Owned by: Peter Dimov
Milestone: To Be Determined Component: bind
Version: Boost Development Trunk Severity: Problem
Keywords: reference_wrapper Cc:

Description

boost::reference_wrapper lacks the ability to forward calls the referenced type's operator(), e.g.:

#include <boost/ref.hpp>
#include <functional>
#include <iostream>

int main()
{
  auto f = [] { std::cout << "Here" << std::endl; };
  //auto rf = boost::ref(f); //No operator() overload.
  auto rf = std::ref(f);

  f();
  rf();

  return 0;
}

There are a few other related differences with the standard, e.g. std::reference_wrapper inherits from std::{binary|unary}_function, may have value_type, etc.

Attachments (0)

Change History (1)

comment:1 Changed 4 years ago by viboes

Component: Nonebind
Owner: set to Peter Dimov

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Peter Dimov.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.