aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/util/noncopyable.hpp
blob: 15903f8adff577416a2ef151983bde3548344137 (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 Vespa.ai. 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