SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
alphabet/exception.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
2// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
3// SPDX-License-Identifier: BSD-3-Clause
4
10#pragma once
11
12#include <concepts>
13#include <stdexcept>
14#include <string>
15
17
18namespace seqan3
19{
20
27{
32 invalid_char_assignment(std::string const & type_name, std::string const & wrong_char) :
33 std::runtime_error{std::string{"Assigning "} + wrong_char + " to an alphabet of type " + type_name
34 + " would incur information loss. If you want implicit conversion, use "
35 "seqan3::assign_char instead of seqan3::assign_char_strict."}
36 {}
37
42 invalid_char_assignment(std::string const & type_name, char const wrong_char) :
43 invalid_char_assignment{type_name, detail::make_printable(wrong_char)}
44 {}
45
50 template <std::convertible_to<char> char_t>
51 invalid_char_assignment(std::string const & type_name, char_t const wrong_char) :
52 invalid_char_assignment{type_name, static_cast<char>(wrong_char)}
53 {}
54};
55
56} // namespace seqan3
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
SeqAn specific customisations in the standard namespace.
Provides seqan3::detail::make_printable which converts non printable characters (e....
An exception typically thrown by seqan3::alphabet::assign_char_strict.
Definition alphabet/exception.hpp:27
invalid_char_assignment(std::string const &type_name, char const wrong_char)
Definition alphabet/exception.hpp:42
invalid_char_assignment(std::string const &type_name, char_t const wrong_char)
Definition alphabet/exception.hpp:51
invalid_char_assignment(std::string const &type_name, std::string const &wrong_char)
Constructor that takes the type name and the failed character as arguments.
Definition alphabet/exception.hpp:32
Hide me