mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-08 03:35:35 +08:00
refs #485, Restricted<T>
This commit is contained in:
committed by
Mathew Sutcliffe
parent
18a907086d
commit
c36028ca9c
30
src/blackmisc/restricted.h
Normal file
30
src/blackmisc/restricted.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/* Copyright (C) 2016
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKMISC_RESTRICTED_H
|
||||
#define BLACKMISC_RESTRICTED_H
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
/*!
|
||||
* Restricted<T> is just an empty class, that can only be constructed by the class T.
|
||||
*/
|
||||
template <typename T> class Restricted
|
||||
{
|
||||
private:
|
||||
friend T;
|
||||
|
||||
//! Constructor is only available to the template parameter T.
|
||||
Restricted() {}
|
||||
};
|
||||
}
|
||||
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user