From 4cf2e2232a2046590909d78c887a2b96a2af8177 Mon Sep 17 00:00:00 2001 From: glisse Date: Sat, 2 Dec 2017 13:34:29 +0000 Subject: Cleanup checks in Simplex_tree Rewrite GUDHi_CHECK so we don't get nasty surprises with: if(cond) GUDHI_CHECK(...) else ... where the else would have been matched with the if in GUDHI_CHECK. git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/ST-glisse@3010 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: a1385540710d0079567b7e4566766bd0da53c584 --- src/Simplex_tree/include/gudhi/Simplex_tree.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/Simplex_tree') diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree.h b/src/Simplex_tree/include/gudhi/Simplex_tree.h index cb6ab309..81dff00d 100644 --- a/src/Simplex_tree/include/gudhi/Simplex_tree.h +++ b/src/Simplex_tree/include/gudhi/Simplex_tree.h @@ -106,8 +106,9 @@ class Simplex_tree { }; struct Key_simplex_base_dummy { Key_simplex_base_dummy() {} - void assign_key(Simplex_key) { } - Simplex_key key() const { assert(false); return -1; } + // Undefined so it will not link + void assign_key(Simplex_key); + Simplex_key key() const; }; typedef typename std::conditional::type Key_simplex_base; @@ -121,7 +122,7 @@ class Simplex_tree { }; struct Filtration_simplex_base_dummy { Filtration_simplex_base_dummy() {} - void assign_filtration(Filtration_value f) { assert(f == 0); } + void assign_filtration(Filtration_value GUDHI_CHECK_code(f)) { GUDHI_CHECK(f == 0, "filtration value specified for a complex that does not store them"); } Filtration_value filtration() const { return 0; } }; typedef typename std::conditional