Mercurial > octave
comparison libinterp/octave-value/ov.h @ 33244:08ab46f6e241
replace uses of assert with panic_impossible in ov.h
* ov.h: Include panic.h.
(octave_value_extract): Replace assert with panic_impossible.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 23 Mar 2024 13:22:58 -0400 |
parents | 54475b490e22 |
children | 106a4a07742a fb44a9db1bc6 |
comparison
equal
deleted
inserted
replaced
33243:d9ed1a322311 | 33244:08ab46f6e241 |
---|---|
33 #include <iosfwd> | 33 #include <iosfwd> |
34 #include <string> | 34 #include <string> |
35 #include <list> | 35 #include <list> |
36 #include <memory> | 36 #include <memory> |
37 #include <map> | 37 #include <map> |
38 | |
39 #include "panic.h" | |
38 | 40 |
39 #include "data-conv.h" | 41 #include "data-conv.h" |
40 #include "idx-vector.h" | 42 #include "idx-vector.h" |
41 #include "mach-info.h" | 43 #include "mach-info.h" |
42 #include "mx-base.h" | 44 #include "mx-base.h" |
1695 OV_COMP_BINOP_FN (op_mul_herm) | 1697 OV_COMP_BINOP_FN (op_mul_herm) |
1696 | 1698 |
1697 extern OCTINTERP_API void install_types (octave::type_info&); | 1699 extern OCTINTERP_API void install_types (octave::type_info&); |
1698 | 1700 |
1699 // Templated value extractors. | 1701 // Templated value extractors. |
1700 // FIXME: would be more consistent to use panic_impossible(), rather than | 1702 |
1701 // assert(), but including "error.h" leads to compilation errors. | |
1702 template <typename Value> | 1703 template <typename Value> |
1703 inline Value octave_value_extract (const octave_value&) | 1704 inline Value octave_value_extract (const octave_value&) |
1704 { assert (false); } | 1705 { panic_impossible (); } |
1705 | 1706 |
1706 #define DEF_VALUE_EXTRACTOR(VALUE,MPREFIX) \ | 1707 #define DEF_VALUE_EXTRACTOR(VALUE,MPREFIX) \ |
1707 template <> \ | 1708 template <> \ |
1708 inline VALUE octave_value_extract<VALUE> (const octave_value& v) \ | 1709 inline VALUE octave_value_extract<VALUE> (const octave_value& v) \ |
1709 { \ | 1710 { \ |
1770 | 1771 |
1771 #define DEF_DUMMY_VALUE_EXTRACTOR(VALUE,DEFVAL) \ | 1772 #define DEF_DUMMY_VALUE_EXTRACTOR(VALUE,DEFVAL) \ |
1772 template <> \ | 1773 template <> \ |
1773 inline VALUE octave_value_extract<VALUE> (const octave_value&) \ | 1774 inline VALUE octave_value_extract<VALUE> (const octave_value&) \ |
1774 { \ | 1775 { \ |
1775 assert (false); \ | 1776 panic_impossible (); \ |
1776 return DEFVAL; \ | 1777 return DEFVAL; \ |
1777 } | 1778 } |
1778 | 1779 |
1779 DEF_DUMMY_VALUE_EXTRACTOR (char, 0) | 1780 DEF_DUMMY_VALUE_EXTRACTOR (char, 0) |
1780 DEF_DUMMY_VALUE_EXTRACTOR (octave_value, octave_value ()) | 1781 DEF_DUMMY_VALUE_EXTRACTOR (octave_value, octave_value ()) |