File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ namespace tao
6060 }
6161 break ;
6262 default :
63- assert ( false );
63+ throw std::logic_error ( " invalid value for tao::json::type " ); // LCOV_EXCL_LINE
6464 }
6565 }
6666
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ namespace tao
5252 result += ' /' ;
5353 break ;
5454 default :
55- assert ( ! " code should be unreachable" ); // LCOV_EXCL_LINE
55+ throw std::logic_error ( " code should be unreachable" ); // LCOV_EXCL_LINE
5656 }
5757 ++p;
5858 break ;
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ namespace tao
1313 // recursively checks for the existence if POINTER nodes,
1414 // returns true is no POINTER nodes were found.
1515 template < template < typename ... > class Traits >
16- bool is_self_contained ( basic_value< Traits > & v )
16+ bool is_self_contained ( basic_value< Traits > & v ) noexcept
1717 {
1818 switch ( v.type () ) {
1919 case json::type::NULL_:
@@ -25,14 +25,14 @@ namespace tao
2525 return true ;
2626 case json::type::ARRAY:
2727 for ( auto & e : v.unsafe_get_array () ) {
28- if ( !is_self_contained ( e ) ) {
28+ if ( ! is_self_contained ( e ) ) {
2929 return false ;
3030 }
3131 }
3232 return true ;
3333 case json::type::OBJECT:
3434 for ( auto & e : v.unsafe_get_object () ) {
35- if ( !is_self_contained ( e.second ) ) {
35+ if ( ! is_self_contained ( e.second ) ) {
3636 return false ;
3737 }
3838 }
@@ -67,7 +67,7 @@ namespace tao
6767 }
6868 return ;
6969 case json::type::POINTER:
70- if ( const auto * p = v.unsafe_get_pointer () ) {
70+ if ( const auto * p = v.unsafe_get_pointer () ) {
7171 v = * p;
7272 make_self_contained ( v );
7373 }
@@ -76,7 +76,7 @@ namespace tao
7676 }
7777 return ;
7878 }
79- assert ( false ); // LCOV_EXCL_LINE
79+ throw std::logic_error ( " invalid value for tao::json::type " ); // LCOV_EXCL_LINE
8080 }
8181
8282 } // json
You can’t perform that action at this time.
0 commit comments