Questions tagged [boost-move]

Boost.Move emulates C++0x move semantics in C++03 compilers and allows writing portable code that works optimally in C++03 and C++0x compilers.

Boost.Move emulates C++0x move semantics in C++03 compilers and allows writing portable code that works optimally in C++03 and C++0x compilers.

7 questions
8
votes
1 answer

Porting C++11 std::thread to boost::thread compile issues

I'm trying to port C++11 std::thread code to VC9 (VS 2008) using boost::thread. The 'equivalent' C++11 code below compiles fine on msvc12: #include #include #include #include #include void…
hhbilly
  • 1,265
  • 10
  • 18
3
votes
0 answers

C++03 forwarding workaround for unique_ptr implementation

I'm working on a C++03 project which requires forwarding semantics with the help of Boost.Move/other Boost libraries. The goal of the project is to provide unique_ptr in a forwards-compatible manner to C++11. The C++11 standard requires the…
helloworld922
  • 10,801
  • 5
  • 48
  • 85
3
votes
2 answers

How should I assign boost::interprocess::unique_ptr returned from a factory function, possibly using boost::move, in C++03

I'm trying to create a factory function that would return boost::interprocess::unique_ptr. Here's an example: #include using namespace boost::interprocess; class my_class { public: my_class()…
Adam Romanek
  • 1,809
  • 1
  • 19
  • 36
2
votes
1 answer

Why does assigning the return value of boost::move() to a non-const reference fails in C++0x mode but works in C++03 mode

Here is the source code that can be used to reproduce the issue: #include #include #include #include std::ostream& dump_to_stream(std::ostream& os, int a, int b) { return os << a…
Adam Romanek
  • 1,809
  • 1
  • 19
  • 36
2
votes
2 answers

Moving an std::string into a boost::thread in C++03

I'm using boost 1.51 on multiple platforms and compilers without C++11. In my main thread I have a very long, expensive to copy, std::string veryLongString, that I need to pass to a new thread for processing. After the new thread is created I have…
Adi Shavit
  • 16,743
  • 5
  • 67
  • 137
1
vote
1 answer

Compiling boost::move in gcc 4.6.4

I have a function that uses Boost::move to move a lock - /** * Moving assignment operator transfers ownership of the lock */ const_iterator& operator=(const_iterator && other) { if (this != &other) { iter = other.iter; lock =…
Kaushik Pavani
  • 381
  • 4
  • 10
0
votes
1 answer

Using C++11 with move semantics - without the standard library (and with Boost.smart_ptr)

I’m working on embedded projects, using Zephyr RTOS with ARM embedded microcontrollers like STM32 Nucleo series (Cortex M4/0). Recently, due to significant C++ support improvements in the recent versions of Zephyr, I’m considering to move from C…