Tannic
A C++ Tensor Library
Loading...
Searching...
No Matches
exceptions.hpp
Go to the documentation of this file.
1// Copyright 2025 Eric Hermosis
2//
3// This file is part of the Tannic Tensor Library.
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing, software
12// distributed under the License is distributed on an "AS IS" BASIS,
13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14// See the License for the specific language governing permissions andx
15// limitations under the License.
16//
17
18#ifndef EXCEPTIONS_HPP
19#define EXCEPTIONS_HPP
20
28#include <exception>
29#include <string>
30
31namespace tannic {
32
44class Exception : public std::exception {
45public:
46 std::string message;
47
48 explicit Exception(const std::string& what)
49 : message(what) {}
50
51 const char* what() const noexcept override {
52 return message.c_str();
53 }
54};
55
56} // namespace exception
57
58#endif // EXCEPTIONS_HPP
A simple generic exception type for the Tannic Tensor Library.
Definition: exceptions.hpp:44
const char * what() const noexcept override
Definition: exceptions.hpp:51
std::string message
Definition: exceptions.hpp:46
Exception(const std::string &what)
Definition: exceptions.hpp:48
Definition: buffer.hpp:41