2022-03-25 14:18:29 +00:00
|
|
|
/***
|
|
|
|
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
|
|
|
|
File: auTryConstruct.hpp
|
|
|
|
Date: 2022-3-25
|
|
|
|
Author: Reece
|
|
|
|
***/
|
|
|
|
#pragma once
|
|
|
|
|
2022-03-26 13:21:31 +00:00
|
|
|
struct AuCtorErrorTag
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
operator bool() const;
|
|
|
|
static constexpr AuCtorCode_t Failed ();
|
|
|
|
static constexpr AuCtorCode_t Success();
|
|
|
|
*/
|
|
|
|
};
|
|
|
|
|
|
|
|
struct AuCtorCode_t : AuCtorErrorTag
|
2022-03-25 14:18:29 +00:00
|
|
|
{
|
2022-03-25 15:11:50 +00:00
|
|
|
bool value;
|
2022-03-25 14:18:29 +00:00
|
|
|
|
2022-03-26 13:21:31 +00:00
|
|
|
inline constexpr AuCtorCode_t()
|
|
|
|
{};
|
|
|
|
|
|
|
|
inline constexpr AuCtorCode_t(bool val) : value(val)
|
|
|
|
{};
|
|
|
|
|
2022-03-25 15:11:50 +00:00
|
|
|
operator bool() const
|
2022-03-25 14:18:29 +00:00
|
|
|
{
|
2022-03-25 15:11:50 +00:00
|
|
|
return value;
|
2022-03-25 14:18:29 +00:00
|
|
|
}
|
|
|
|
|
2022-03-25 15:11:50 +00:00
|
|
|
static constexpr AuCtorCode_t Failed () { return AuCtorCode_t {false}; }
|
2022-03-26 12:02:08 +00:00
|
|
|
static constexpr AuCtorCode_t Success() { return AuCtorCode_t {true}; }
|
2022-03-25 15:11:50 +00:00
|
|
|
};
|