Boost logo

Boost Users :

Subject: [Boost-users] boost optional assignment
From: tolik levchik (endight_at_[hidden])
Date: 2012-08-17 07:35:39


The following code gives me compilation error. With const reference it's
ok. Is it right behaviour?

#include <boost/optional.hpp>
#include <boost/shared_ptr.hpp>

struct foo{
// foo(int const& of) good
    foo(int& of) // error
    {}
};

int main(){
    boost::shared_ptr<int> ptr;

    boost::optional<foo> opt;
    opt = *ptr;
}



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net