Boost logo

Boost Users :

Subject: Re: [Boost-users] [container] Initialization from transformed_range compilation error
From: Szymon Gatner (szymon.gatner_at_[hidden])
Date: 2011-09-06 18:05:19


2011/9/6 Ion Gaztañaga <igaztanaga_at_[hidden]>:
>
> Yes. Have you updated Boost.Move and Boost.Container to the latest version?
>

I checked twice to make sure I updated properly before replying last time but it
seems it was not enough ;)

It works properly now of course. Sorry for confusion and thanks for
the quick fix.

On a related note: what is the correct way to return named boost::container
from a function in non-rvalue reference compiler (VS 2008 SP1) to make sure
moving will be used instead of copying?

My guess is that explicit move() call is needed to perform a conversion to rv
object but maybe boost.move somehow detects movability on its own?
Docs are not clear on that matter - only example I found returns a temporary:

  file_descriptor create_file_descriptor(const char *filename)
  { return file_descriptor(filename); }

I mean:

  vector<int> makeNumbers()
  {
    vector<int> ret;
    // fills ret;
    return boost::move(ret) // <---------- or just: return ret; ?
  }

Regards,
Simon


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