Opened 10 years ago

Closed 6 years ago

#6848 closed Bugs (duplicate)

ref doesn't work with noncopyable object

Reported by: Maxim Yanchenko <Maxim.Yanchenko@…> Owned by: Thomas Heller
Milestone: To Be Determined Component: phoenix
Version: Boost 1.49.0 Severity: Problem
Keywords: Cc:

Description

the following code fails to compile with both boost 1.47 and 1.49 (GCC 4.4.4):

#include <boost/phoenix.hpp>

class A
{
    A(const A&);
    A& operator=(const A&);
public:
    A() {}
    const A& operator<<(const char *p) const 
    { 
        return *this; 
    }
} g_a;

int main()
{
  ( boost::phoenix::ref(g_a) << boost::phoenix::placeholders::_1 )("test");
}

error: 'A::A(const A&)' is private

Btw, it also doesn't work with boost::lambda::var, in the same manner.

Change History (1)

comment:1 by Kohei Takahashi, 6 years ago

Resolution: duplicate
Status: newclosed

dup of #6026

Note: See TracTickets for help on using tickets.