aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/util/noncopyable.hpp
blob: 249d07f6d9875b586dc8415cfe226c4f62ea2a85 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

namespace vespalib {

/**
 * A convenience class that ensures classes inheriting this cannot be
 * copied.
 */
namespace noncopyable_
{
    class noncopyable
    {
    protected:
        noncopyable() {}
        ~noncopyable() {}
    private:
        noncopyable(const noncopyable &);
        const noncopyable & operator=(const noncopyable &);
  };
}

using noncopyable = noncopyable_::noncopyable;

} // namespace vespalib