SeqAn3  3.0.1
The Modern C++ library for sequence analysis.
exception.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2020, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2020, Knut Reinert & MPI für molekulare Genetik
4 // This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
5 // shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
6 // -----------------------------------------------------------------------------------------------------
7 
13 #pragma once
14 
15 #include <stdexcept>
16 #include <string>
17 
19 #include <seqan3/std/concepts>
20 
21 namespace seqan3
22 {
23 
26 {
28  invalid_char_assignment(std::string const & type_name, std::string const & wrong_char) :
29  std::runtime_error{std::string{"Assigning "} + wrong_char + " to an alphabet of type " +
30  type_name + " would incur information loss. If you want implicit conversion, use "
31  "seqan3::assign_char instead of seqan3::assign_char_strict."}
32  {}
33 
35  invalid_char_assignment(std::string const & type_name, char const wrong_char) :
36  invalid_char_assignment{type_name, detail::make_printable(wrong_char)}
37  {}
38 
40  template <std::convertible_to<char> char_t>
41  invalid_char_assignment(std::string const & type_name, char_t const wrong_char) :
42  invalid_char_assignment{type_name, static_cast<char>(wrong_char)}
43  {}
44 };
45 
46 } // namespace seqan3
std::string
pretty_print.hpp
Provides pretty printing for chars.
seqan3::invalid_char_assignment::invalid_char_assignment
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: exception.hpp:28
concepts
The Concepts library.
stdexcept
seqan3::invalid_char_assignment
An exception typically thrown by seqan3::alphabet::assign_char_strict.
Definition: exception.hpp:25
seqan3
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:36
std::runtime_error
std
SeqAn specific customisations in the standard namespace.
seqan3::invalid_char_assignment::invalid_char_assignment
invalid_char_assignment(std::string const &type_name, char_t const wrong_char)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: exception.hpp:41
seqan3::invalid_char_assignment::invalid_char_assignment
invalid_char_assignment(std::string const &type_name, char const wrong_char)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: exception.hpp:35
string