[Boost-bugs] [Boost C++ Libraries] #6648: managed_unique_ptr cannot be used inside template (VS2008).

Subject: [Boost-bugs] [Boost C++ Libraries] #6648: managed_unique_ptr cannot be used inside template (VS2008).
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-03-03 06:04:52


#6648: managed_unique_ptr cannot be used inside template (VS2008).
------------------------------+---------------------------------------------
 Reporter: anonymous | Owner: igaztanaga
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: interprocess
  Version: Boost 1.49.0 | Severity: Problem
 Keywords: |
------------------------------+---------------------------------------------
 There is a very simple example:

 {{{
 #!cpp
 #include <iostream>

 #include <boost/interprocess/managed_windows_shared_memory.hpp>

 #include <boost/interprocess/smart_ptr/unique_ptr.hpp>
 #include <boost/interprocess/allocators/allocator.hpp>
 #include <boost/interprocess/containers/list.hpp>
 #include <boost/interprocess/sync/named_mutex.hpp>
 #include <boost/interprocess/sync/named_condition.hpp>
 #include <boost/interprocess/sync/scoped_lock.hpp>

 struct Request
 {
  int a;
 };

 template<typename Segment, typename T>
 class Channel
 {
 public:

  /// Value pointer in queue.
  typedef typename boost::interprocess::managed_unique_ptr<T,
 Segment>::type
   ValuePtr;

 };

 int main(int argc, char* argv[])
 {
  Channel<boost::interprocess::managed_windows_shared_memory,
 Request>::ValuePtr v;

  std::cout << "Test" << std::endl;

  return 0;
 }

 }}}

 I got this error in Visual Studio 2008:
 {{{
 T.cpp
 C:\Program
 Files\boost\boost_1_49_0\boost/interprocess/detail/pointer_type.hpp(64) :
 error C2039: 'remove_reference' : is not a member of
 'boost::interprocess::ipcdetail::ipcdetail'
         C:\Program
 Files\boost\boost_1_49_0\boost/interprocess/smart_ptr/unique_ptr.hpp(94) :
 see reference to class template instantiation
 'boost::interprocess::ipcdetail::pointer_type<T,D>' being compiled
         with
         [
             T=Request,
 D=boost::interprocess::deleter<Request,boost::interprocess::segment_manager<char,boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family>,boost::interprocess::iset_index>>
         ]
         T.cpp(34) : see reference to class template instantiation
 'boost::interprocess::unique_ptr<T,D>' being compiled
         with
         [
             T=Request,
 D=boost::interprocess::deleter<Request,boost::interprocess::segment_manager<char,boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family>,boost::interprocess::iset_index>>
         ]
 C:\Program
 Files\boost\boost_1_49_0\boost/interprocess/detail/pointer_type.hpp(64) :
 error C2947: expecting '>' to terminate template-argument-list, found '<'
 C:\Program
 Files\boost\boost_1_49_0\boost/interprocess/detail/pointer_type.hpp(64) :
 error C3203: 'remove_reference' : unspecialized class template can't be
 used as a template argument for template parameter 'D', expected a real
 type
 C:\Program
 Files\boost\boost_1_49_0\boost/interprocess/detail/pointer_type.hpp(64) :
 error C2955: 'boost::interprocess::ipcdetail::remove_reference' : use of
 class template requires template argument list
         C:\Program
 Files\boost\boost_1_49_0\boost/interprocess/detail/type_traits.hpp(30) :
 see declaration of 'boost::interprocess::ipcdetail::remove_reference'
 C:\Program
 Files\boost\boost_1_49_0\boost/interprocess/detail/pointer_type.hpp(64) :
 error C2143: syntax error : missing ';' before '>'
 C:\Program
 Files\boost\boost_1_49_0\boost/interprocess/detail/pointer_type.hpp(64) :
 error C2039: 'type' : is not a member of '`global namespace''
 C:\Program
 Files\boost\boost_1_49_0\boost/interprocess/detail/pointer_type.hpp(64) :
 error C2039: 'type' : is not a member of '`global namespace''
 C:\Program
 Files\boost\boost_1_49_0\boost/interprocess/detail/pointer_type.hpp(64) :
 error C2238: unexpected token(s) preceding ';'
 C:\Program
 Files\boost\boost_1_49_0\boost/interprocess/smart_ptr/unique_ptr.hpp(94) :
 error C2039: 'type' : is not a member of
 'boost::interprocess::ipcdetail::pointer_type<T,D>'
 ................
 }}}

 This example works fine in boost 1.48.0

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6648>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:09 UTC