/
Ant010ff
/
ffpp
Обзор
Документация
Войти
/
Ant010ff
/
ffpp
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
include/exceptionbase.hpp
91 строка
2 KB
Ant010ff
Version 2.11.3.
08 авг 2026, 16:44
08 авг 2026, 16:44
fd187d3
Код
Авторство
О чём код?
/* This header is part of a Functional Flow Processing Primitives (FFPP) library, version 2.11.3. Official repository: https://gitlab.com/ant010ff/ffpp Licensed under the MIT License <http://opensource.org/licenses/MIT>. SPDX-License-Identifier: MIT Copyright (c) 2021 - 2026 Anton Nasonov <ant010fff @ gmail . com>. */ #ifndef FFPP_EXCEPTION_BASE_HPP #define FFPP_EXCEPTION_BASE_HPP namespace FFPP { //Required for exception message formatting and debugging support. using StringT = std::string; using StringViewT = std::string_view; using CharT = StringT::value_type; }//FFPP namespace FFPP::Base { struct Exception { Exception() noexcept { } Exception(StringViewT) noexcept { } virtual ~Exception() = default; virtual StringViewT View() const noexcept = 0; }; }//FFPP::Base namespace FFPP::Concepts { template<typename TException> concept Exception = std::derived_from<TException, std::exception> || std::derived_from<TException, FFPP::Base::Exception>; }//FFPP namespace FFPP::Base { template<Concepts::Exception TBase = std::exception> struct ExceptionAdaptor : public Exception , public TBase { virtual ~ExceptionAdaptor() = default; ExceptionAdaptor() noexcept : TBase("") //assumed that there will be no internal memory allocation { } ExceptionAdaptor(StringViewT) noexcept : TBase("") { } virtual StringViewT View() const noexcept override { return { }; } }; template<> struct ExceptionAdaptor<std::exception> : public Exception , public std::exception { virtual ~ExceptionAdaptor() = default; ExceptionAdaptor() noexcept { } ExceptionAdaptor(StringViewT) noexcept { } virtual StringViewT View() const noexcept override { return { }; } }; template<> struct ExceptionAdaptor<Exception> : public Exception , public std::exception { virtual ~ExceptionAdaptor() = default; ExceptionAdaptor() noexcept { } ExceptionAdaptor(StringViewT) noexcept { } virtual StringViewT View() const noexcept override { return { }; } }; }//FFPP::Base #endif//FFPP_EXCEPTION_BASE_HPP