LeechCraft 0.6.70-16373-g319c272718
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
requiresinit.h
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#pragma once
10
11namespace LC::Util
12{
13 template<typename T>
15 {
17
18 RequiresInit () = delete;
19
20 constexpr RequiresInit (const RequiresInit&) = default;
21 constexpr RequiresInit (RequiresInit&&) = default;
22
23 constexpr RequiresInit& operator= (const RequiresInit&) = default;
24 constexpr RequiresInit& operator= (RequiresInit&&) = default;
25
26 constexpr RequiresInit (T&& val)
27 : Val_ { std::forward<T> (val) }
28 {
29 }
30
31 template<typename... Args>
32 constexpr RequiresInit (Args&&... args)
33 : Val_ { std::forward<Args> (args)... }
34 {
35 }
36
37 constexpr operator T () const
38 {
39 return Val_;
40 }
41 };
42}
STL namespace.
constexpr RequiresInit(T &&val)
constexpr RequiresInit(Args &&... args)
constexpr RequiresInit(const RequiresInit &)=default
constexpr RequiresInit & operator=(const RequiresInit &)=default
constexpr RequiresInit(RequiresInit &&)=default