Boost logo

Boost :

From: Bronek Kozicki (brok_at_[hidden])
Date: 2004-01-21 06:01:15


On Wed, 21 Jan 2004 01:06:09 +0100, Daniel Wallin wrote:
> I'm attaching the implementation that I believe should be pushed
> further.

You probably missed something:

#include "move_ptr.hpp"
using namespace boost;
int main()
{
  volatile move_ptr<int> c = move_ptr<int> (new int);
  volatile move_ptr<int> d = move(c);
}

Under MSVC71 I have:

T201.cpp(7) : error C2440: 'initializing' : cannot convert from
'boost::move_source<T>' to 'boost::move_ptr<T>'
        with
        [
            T=volatile boost::move_ptr<int>
        ]
        and
        [
            T=int
        ]
        No constructor could take the source type, or constructor
overload resolution was ambiguous
        T201.cpp(7) : see reference to class template instantiation
'boost::move_ptr<T>::cant_move_from_const<U>' being compiled
        with
        [
            T=int,
            U=boost::move_source<volatile boost::move_ptr<int>>
        ]
        T201.cpp(7) : see reference to class template instantiation
'boost::move_ptr<T>::cant_move_from_const<U>' being compiled
        with
        [
            T=int,
            U=boost::move_source<volatile boost::move_ptr<int>>
        ]
        T201.cpp(6) : see reference to class template instantiation
'boost::move_ptr<T>::cant_move_from_const<U>' being compiled
        with
        [
            T=int,
            U=boost::move_ptr<int>
        ]
        T201.cpp(6) : see reference to class template instantiation
'boost::move_ptr<T>::cant_move_from_const<U>' being compiled
        with
        [
            T=int,
            U=int *
        ]
        T201.cpp(6) : see reference to class template instantiation
'boost::move_ptr<T>::cant_move_from_const<U>' being compiled
        with
        [
            T=int,
            U=int *
        ]

Under GCC 3.3.1 it looks much simpler:
T201.cpp:7: error: conversion from `
   boost::move_source<volatile boost::move_ptr<int> >' to non-scalar type `
   boost::move_ptr<int>' requested

B.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk