refs #485, Restricted<T>

This commit is contained in:
Klaus Basan
2016-03-13 19:37:26 +00:00
committed by Mathew Sutcliffe
parent 18a907086d
commit c36028ca9c
8 changed files with 47 additions and 20 deletions

View 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