Defines macros for hiding C++11 features in public headers for clients that use C++98.
More...
Defines macros for hiding C++11 features in public headers for clients that use C++98.
- C++11 in libfoedus
- We basically do assume C++11 and our library provides the best flexibility when the client program enables C++11. For example, the client program can simply contain foedus-core as a subfolder and statically link to it if C++11 is enabled. However, some client program might have to stick to C++98. In that case, we provide our library as an external shared library which comes with public headers that at least compile in C++98. Thus, we will make sure C++11 keywords and classes do not directly appear in public header files. The macros defined in this file are for that switching.
- DISABLE_CXX11_IN_PUBLIC_HEADERS macro
- This macro is defined if __cplusplus < 201103L, meaning the compiler option for the programs that include this header file (note: which is different from compiler option for libfoedus) disables C++11. If defined, our public headers must hide all C++11 dependent APIs. So, there are several ifdefs on this macro in public headers.
- stdint.h vs cstdint
- For the same reason, we include stdint.h rather than cstdint. cstdint is a C++11 extension, which defines those integer types in std namespace (eg std::int32_t). The integer types in global namespace are more concise to use, too.
- C++11 in cpp and non-public headers
- Remember, this is only for public headers. We anyway compile our library with C++11. We can freely use C++11 keywords/features in cpp and non-public header files, such as xxx_impl.hpp, and xxx_pimpl.hpp. In other words, client programs must not include them unless they turn on C++11. Also, impl/pimpl header files often include too much details for client programs to rely on. They might change in next versions.
#define CXX11_CONSTEXPR constexpr |
Used in public headers in place of "constexpr" of C++11.
- Note
- C++98 : nothing.
Definition at line 130 of file cxx11.hpp.
#define CXX11_FINAL final |
Used in public headers in place of "final" of C++11.
- Note
- C++98 : nothing.
Definition at line 131 of file cxx11.hpp.
#define CXX11_FUNC_DEFAULT = default |
Used in public headers in place of " = default" of C++11.
- Note
- C++98 : nothing.
Definition at line 129 of file cxx11.hpp.
#define CXX11_FUNC_DELETE = delete |
Used in public headers in place of " = delete" of C++11.
- Note
- C++98 : nothing.
Definition at line 128 of file cxx11.hpp.
#define CXX11_NOEXCEPT noexcept |
Used in public headers in place of "noexcept" of C++11.
- Note
- C++98 : nothing.
Definition at line 133 of file cxx11.hpp.
#define CXX11_NULLPTR nullptr |
Used in public headers in place of "nullptr" of C++11.
- Note
- C++98 : NULL.
Definition at line 132 of file cxx11.hpp.
Referenced by foedus::xct::Xct::add_to_write_set(), foedus::storage::sequential::SequentialAppendLogType::apply_record(), foedus::storage::masstree::RecordLocation::clear(), foedus::storage::hash::RecordLocation::clear(), foedus::memory::AlignedMemorySlice::clear(), foedus::ErrorStack::clear_custom_message(), foedus::storage::Storage< MasstreeStorageControlBlock >::exists(), foedus::ErrorStack::get_custom_message(), foedus::ErrorStack::get_filename(), foedus::ErrorStack::get_func(), foedus::storage::masstree::MasstreeStorage::insert_record(), foedus::storage::masstree::MasstreeStorage::insert_record_normalized(), foedus::memory::SharedMemory::is_null(), foedus::memory::AlignedMemory::is_null(), foedus::thread::ImpersonateSession::is_valid(), foedus::snapshot::LogReducerRef::LogReducerRef(), foedus::ErrorStack::operator=(), foedus::soc::SharedMutex::timedlock(), foedus::soc::SharedCond::timedwait(), foedus::storage::masstree::MasstreeStorage::upsert_record(), and foedus::storage::masstree::MasstreeStorage::upsert_record_normalized().
#define CXX11_OVERRIDE override |
Used in public headers in place of "override" of C++11.
- Note
- C++98 : nothing.
Definition at line 134 of file cxx11.hpp.
#define CXX11_STATIC_ASSERT |
( |
|
expr, |
|
|
|
message |
|
) |
| static_assert(expr, message) |