44
55#include < iostream>
66#include < string>
7- #include < optional>
87#include < vector>
98#include < utility>
109
@@ -17,8 +16,8 @@ namespace lib_interval_tree
1716 std::vector<std::string> extra_node_attributes = {};
1817 std::vector<std::string> extra_statements = {};
1918 bool space_after_comma = false ;
20- std::optional< char > left_brace = std:: nullopt ;
21- std::optional< char > right_brace = std:: nullopt ;
19+ char left_brace = ' \0 ' ;
20+ char right_brace = ' \0 ' ;
2221 std::vector<std::string> edge_attributes = {};
2322 std::string indent = " \t " ;
2423 };
@@ -40,27 +39,27 @@ namespace lib_interval_tree
4039 using ival_type = typename TreeT::interval_type;
4140
4241 const auto determine_brace = []() {
43- if (std::is_same_v <typename ival_type::interval_kind, closed>)
42+ if (std::is_same <typename ival_type::interval_kind, closed>::value )
4443 return " []" ;
45- else if (std::is_same_v <typename ival_type::interval_kind, left_open>)
44+ else if (std::is_same <typename ival_type::interval_kind, left_open>::value )
4645 return " (]" ;
47- else if (std::is_same_v <typename ival_type::interval_kind, right_open>)
46+ else if (std::is_same <typename ival_type::interval_kind, right_open>::value )
4847 return " [)" ;
49- else if (std::is_same_v <typename ival_type::interval_kind, open>)
48+ else if (std::is_same <typename ival_type::interval_kind, open>::value )
5049 return " ()" ;
51- else if (std::is_same_v <typename ival_type::interval_kind, closed_adjacent>)
50+ else if (std::is_same <typename ival_type::interval_kind, closed_adjacent>::value )
5251 return " []" ;
5352 else
5453 return " []" ;
5554 };
5655
57- if (settings_.left_brace )
58- left_brace_ = * settings_.left_brace ;
56+ if (settings_.left_brace != ' \0 ' )
57+ left_brace_ = settings_.left_brace ;
5958 else
6059 left_brace_ = determine_brace ()[0 ];
6160
62- if (settings_.right_brace )
63- right_brace_ = * settings_.right_brace ;
61+ if (settings_.right_brace != ' \0 ' )
62+ right_brace_ = settings_.right_brace ;
6463 else
6564 right_brace_ = determine_brace ()[1 ];
6665 }
@@ -78,7 +77,7 @@ namespace lib_interval_tree
7877 void make_label (T const & ival)
7978 {
8079#if __cplusplus >= 201703L
81- if constexpr (std::is_same_v <typename T::interval_kind, dynamic>)
80+ if constexpr (std::is_same <typename T::interval_kind, dynamic>::value )
8281 {
8382 stream_ << (ival.left_border () == interval_border::open ? ' (' : ' [' ) << ival.low ()
8483 << (settings_.space_after_comma ? " , " : " ," ) << ival.high ()
@@ -203,7 +202,7 @@ namespace lib_interval_tree
203202 template <typename TreeT>
204203 void draw_dot_graph (std::ostream& stream, TreeT const & tree, dot_graph_draw_settings const & settings = {})
205204 {
206- detail::graph_painter painter{stream, tree, settings};
205+ detail::graph_painter<TreeT> painter{stream, tree, settings};
207206 painter.make_header ();
208207 if (tree.empty ())
209208 {
0 commit comments