lucenaBAL
2.0.0.20
Lucena Build Abstraction Library for C++
namespace_example.cpp
This is an example of how the various namespace macros are used.
#include <lucenaBAL/lucenaBAL.hpp>
// This must be invoked from the global namespace scope. After this, our
// namespace will be something like `::lucena::bal`.
LBAL_begin_namespace
void
A() { }
// This must be invoked from the unversioned namespace scope. After this, our
// namespace will be something like `::lucena::bal::inline bal_2`.
LBAL_enter_v_namespace
void
B() { }
// After this, we’ll be back in `::lucena::bal`.
LBAL_exit_v_namespace
// After this, we’re back at global namespace scope.
LBAL_end_namespace
// This takes us straight to the versioned namespace scope from the global
// namespace scope. Our current namespace will be something like
// `::lucena::bal::inline bal_2`.
LBAL_begin_v_namespace
void
B() { }
// After this, we’re back at global namespace scope.
LBAL_end_v_namespace
int
main()
{
LBAL_::A();
// Invokes function A() from the unversioned namespace;
// resolves to something like `::lucena::bal::A()`.
LBAL_v_::B();
// Invoke functions B() and C() from a specific versioned
LBAL_v_::C();
// namespace; these resolve to something like
// `::lucena::bal::inline bal_2::B()` and
// `::lucena::bal::inline bal_2::C()`.
LBAL_::B();
// Invokes function B() from the regular namespace;
// this will be whatever function B() is defined in the
// current versioned namespace at the time of compilation.
// It will behave as if it resolves to something like
// `::lucena::bal::B()`, but the actual fully qualified
// name will be like `::lucena::bal::inline bal_2::B()`.
return
0;
}
LBAL_exit_v_namespace
#define LBAL_exit_v_namespace
Exit the versioned namespace and return to the unversioned namespace.
Definition:
lbalConfig.hpp:396
LBAL_begin_v_namespace
#define LBAL_begin_v_namespace
Enter the versioned namespace from the global namespace.
Definition:
lbalConfig.hpp:407
LBAL_end_v_namespace
#define LBAL_end_v_namespace
Exit the versioned namespace and return to the global namespace.
Definition:
lbalConfig.hpp:423
LBAL_begin_namespace
#define LBAL_begin_namespace
Enter the regular namespace.
Definition:
lbalConfig.hpp:349
LBAL_enter_v_namespace
#define LBAL_enter_v_namespace
Enter the versioned namespace from the unversioned namespace.
Definition:
lbalConfig.hpp:380
LBAL_end_namespace
#define LBAL_end_namespace
Exit the regular namespace and return to the global namespace.
Definition:
lbalConfig.hpp:364
Generated by
1.8.16