1 /***************************************************************************
2  *  include/stxxl/bits/noncopyable.h
3  *
4  *  Inspired by boost::noncopyable.
5  *
6  *  Part of the STXXL. See http://stxxl.sourceforge.net
7  *
8  *  Copyright (C) 2007 Andreas Beckmann <beckmann@mpi-inf.mpg.de>
9  *
10  *  Distributed under the Boost Software License, Version 1.0.
11  *  (See accompanying file LICENSE_1_0.txt or copy at
12  *  http://www.boost.org/LICENSE_1_0.txt)
13  **************************************************************************/
14 
15 #ifndef STXXL_NONCOPYABLE_HEADER
16 #define STXXL_NONCOPYABLE_HEADER
17 
18 #include <stxxl/bits/config.h>
19 #include <stxxl/bits/namespace.h>
20 
21 #if STXXL_BOOST_CONFIG
22   #include <boost/noncopyable.hpp>
23 #endif
24 
25 STXXL_BEGIN_NAMESPACE
26 
27 #if STXXL_BOOST_CONFIG
28 
29 typedef boost::noncopyable noncopyable;
30 
31 #else
32 
33 class noncopyable
34 {
35 protected:
36     noncopyable() { }
37 
38 private:
39     // copying and assignment is not allowed
40     noncopyable(const noncopyable&);
41     const noncopyable& operator = (const noncopyable&);
42 };
43 
44 #endif
45 
46 STXXL_END_NAMESPACE
47 
48 #endif // !STXXL_NONCOPYABLE_HEADER
49