Boost logo

Boost Users :

Subject: Re: [Boost-users] [container] Initialization from transformed_range compilation error
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2011-09-07 06:57:36

El 07/09/2011 0:05, Szymon Gatner escribió:

It's moved, this feature produces the limitation (must define
copy-constructor for copyable types owning copyable and movables classes
like boost::container::vector) that Daniel has suffered. Example:

#include <boost/container/vector.hpp>
#include <string>

struct template_symbol

    template_symbol(const template_symbol &x)
       : params(x.params)

    template_symbol& operator=(const template_symbol &x)
       params = x.params;
       return *this;

    boost::container::vector<std::string> params;

boost::container::vector<template_symbol> func()
    return boost::container::vector<template_symbol>();

int main()
    boost::container::vector<template_symbol> x (func());
    x = func();
    return 0;

I think I'd should add this info to container documentation.



Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at