Encapsulate DUMP contents in "do { ... } while (0)"

This makes the macro more function-like and easier to read.
This commit is contained in:
Bård Skaflestad committed 2013-06-03 00:15:40 +02:00
1 parent 2606d94935
commit a67ca87fd3
1 file changed
+6 -1
+6 -1
View File
@@ -35,7 +35,12 @@
#include <cmath>
#include <iomanip>
#define DUMP(foo) std::cout << "==========================================\n" #foo ":\n" << collapseJacs(foo) << std::endl
#define DUMP(foo) \
do { \
std::cout << "==========================================\n" \
<< #foo ":\n" \
<< collapseJacs(foo) << std::endl; \
} while (0)
typedef AutoDiff::ForwardBlock<double> ADB;
typedef ADB::V V;