Can somebody tell me how to use scoped_ptr?

If I do the following changes:

Index: src/MenuBackend.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/MenuBackend.h,v
retrieving revision 1.19
diff -u -r1.19 MenuBackend.h
--- src/MenuBackend.h   22 Jul 2002 20:12:08 -0000      1.19
+++ src/MenuBackend.h   22 Jul 2002 20:18:50 -0000
@@ -20,9 +20,11 @@

  #include "LString.h"
  #include <vector>
+#include <boost/scoped_ptr.hpp>

  class LyXLex;
  class Buffer;
+class Menu;

  ///
  class MenuItem {
@@ -99,6 +101,8 @@
        string submenu_;
        ///
        bool optional_;
+ 
///
+ 
boost::scoped_ptr<Menu> submenuptr;
  };



I get the following errors which are just chinese to me.

So, how does this work?

JMarc

g++ -DHAVE_CONFIG_H -I. -I../../lyx-devel/src -I. 
-I../../lyx-devel/boost   -isystem /usr/X11R6/include  -g 
-fno-exceptions -Wno-non-template-friend -W -Wall
-c ../../lyx-devel/src/MenuBackend.C
/usr/include/g++-3/stl_construct.h: In method `MenuItem::MenuItem
(const MenuItem &)':
/usr/include/g++-3/stl_construct.h:48:   instantiated from `construct 
(_T1 *, const _T2 &) [with _T1 = MenuItem, _T2 = MenuItem]'
/usr/include/g++-3/stl_vector.h:321:   instantiated from `vector<_Tp, 
_Alloc>::push_back (const _Tp &) [with _Tp = MenuItem, _Alloc = 
allocator<MenuItem>]'
../../lyx-devel/src/MenuBackend.C:97:   instantiated from here
../../lyx-devel/boost/boost/scoped_ptr.hpp:32: 
`boost::scoped_ptr<T>::scoped_ptr (const
boost::scoped_ptr<T> &) [with T = Menu]' is private
/usr/include/g++-3/stl_construct.h:48: within this context
/usr/include/g++-3/stl_vector.h: In method `MenuItem
&MenuItem::operator= (const MenuItem &)':
/usr/include/g++-3/stl_vector.h:595:   instantiated from `vector<_Tp, 
_Alloc>::_M_insert_aux (_Tp *, const _Tp &) [with _Tp = MenuItem, _Alloc 
= allocator<MenuItem>]'
/usr/include/g++-3/stl_vector.h:325:   instantiated from `vector<_Tp, 
_Alloc>::push_back (const _Tp &) [with _Tp = MenuItem, _Alloc = 
allocator<MenuItem>]'
../../lyx-devel/src/MenuBackend.C:97:   instantiated from here
../../lyx-devel/boost/boost/scoped_ptr.hpp:33: `boost::scoped_ptr<T> 
&boost::scoped_ptr<T>::operator=
(const boost::scoped_ptr<T> &) [with T = Menu]' is private
/usr/include/g++-3/stl_vector.h:595: within this context

Reply via email to