The next commit introduces conversion functions between
objects in the checked C++ bindings and objects
in the unchecked C++ bindings.
These conversion functions need to reference types
in both bindings at the same time, meaning that
the checked namespace cannot be inlined.
This means that a user who does not want to explicitly
mention the "checked" namespace (implying that only
the checked bindings are used), will have to do
the "inlining" herself.
Signed-off-by: Sven Verdoolaege <sven.verdoolaege@gmail.com>
#include <string>
namespace isl {
-inline namespace checked {
+namespace checked {
#define ISLPP_STRINGIZE_(X) #X
#define ISLPP_STRINGIZE(X) ISLPP_STRINGIZE_(X)
@@ -80,7 +80,7 @@ static std::string to_string(long l)
* implementations.
*
* If checked C++ bindings are being generated,
- * then wrap them in an inline namespace to avoid conflicts
+ * then wrap them in a namespace to avoid conflicts
* with the default C++ bindings (with automatic checks using exceptions).
*/
void cpp_generator::generate()
@@ -90,7 +90,7 @@ void cpp_generator::generate()
osprintf(os, "\n");
osprintf(os, "namespace isl {\n\n");
if (checked)
- osprintf(os, "inline namespace checked {\n\n");
+ osprintf(os, "namespace checked {\n\n");
print_forward_declarations(os);
osprintf(os, "\n");
#include <isl/options.h>
#include <isl/cpp-checked.h>
+namespace isl { using namespace checked; }
+
static void assert_impl(bool condition, const char *file, int line,
const char *message)
{