1 //=======================================================================
2 // Copyright 2002 Indiana University.
3 // Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek
5 // Distributed under the Boost Software License, Version 1.0. (See
6 // accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
8 //=======================================================================
10 #ifndef BOOST_GRAPH_EXCEPTION_HPP
11 #define BOOST_GRAPH_EXCEPTION_HPP
18 struct bad_graph : public std::invalid_argument {
19 bad_graph(const std::string& what_arg)
20 : std::invalid_argument(what_arg) { }
23 struct not_a_dag : public bad_graph {
25 : bad_graph("The graph must be a DAG.") { }
28 struct negative_edge : public bad_graph {
30 : bad_graph("The graph may not contain an edge with negative weight."){ }
33 struct negative_cycle : public bad_graph {
35 : bad_graph("The graph may not contain negative cycles.") { }
37 struct not_connected : public bad_graph {
39 : bad_graph("The graph must be connected.") { }
44 #endif // BOOST_GRAPH_EXCEPTION_HPP