Comments (5)
Hi,
thanks for this catch. clang 3.6 does not fully support all C++11 features (traits in this case).
It should work with this PR #325 (will be merged after code review).
from libpmemobj-cpp.
@freboat I strongly recommend to upgrade your compiler, this should fix the issue. However, if you want to use clang 3.6 you can wait until #325 is merged or apply the following patch :
---
include/libpmemobj++/detail/common.hpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/libpmemobj++/detail/common.hpp b/include/libpmemobj++/detail/common.hpp
index d570464..aba2063 100644
--- a/include/libpmemobj++/detail/common.hpp
+++ b/include/libpmemobj++/detail/common.hpp
@@ -95,7 +95,15 @@
* and 0 in gcc. It means that for gcc < 5 IS_TRIVIALLY_COPYABLE is more
* restrictive than is_trivially_copyable.
*/
+#if !defined(LIBPMEMOBJ_CPP_USE_HAS_TRIVIAL_COPY)
#if !defined(__clang__) && defined(__GNUG__) && __GNUC__ < 5
+#define LIBPMEMOBJ_CPP_USE_HAS_TRIVIAL_COPY 1
+#else
+#define LIBPMEMOBJ_CPP_USE_HAS_TRIVIAL_COPY 0
+#endif
+#endif
+
+#if LIBPMEMOBJ_CPP_USE_HAS_TRIVIAL_COPY
#define IS_TRIVIALLY_COPYABLE(T) __has_trivial_copy(T)
#else
#define IS_TRIVIALLY_COPYABLE(T) std::is_trivially_copyable<T>::value
--
After that, to compile libpmemobj-cpp tests and examples with your clang version please run cmake with: -DCMAKE_CXX_FLAGS=-DLIBPMEMOBJ_CPP_USE_HAS_TRIVIAL_COPY=1. If you want to compile your application with libmemobj-cpp using clang 3.6 you must set LIBPMEMOBJ_CPP_USE_HAS_TRIVIAL_COPY=1 in your code or during compilation.
from libpmemobj-cpp.
@szyrom & @igchor thanks for your kind reply,
i updated clang to 3.9 run cmake with -DCMAKE_CXX_FLAGS=-DLIBPMEMOBJ_CPP_USE_HAS_TRIVIAL_COPY=1
but got another error:
In file included from /home/brook/pmem/libpmemobj-cpp/tests/string_exceptions/string_exceptions.cpp:35:
/home/brook/pmem/libpmemobj-cpp/include/libpmemobj++/experimental/slice.hpp:79:15: error: no member named 'out_of_range' in namespace
'std'
throw std::out_of_range("pmem::obj::slice");
~~~~~^
/home/brook/pmem/libpmemobj-cpp/include/libpmemobj++/experimental/slice.hpp:137:15: error: no member named 'out_of_range' in namespace
'std'
throw std::out_of_range("pmem::obj::slice");
~~~~~^
from libpmemobj-cpp.
@ALL, i have fixed the error,
include/libpmemobj++/experimental/slice.hpp lost the stdexcept headfile, just add and it works:
#include <stdexcept>
from libpmemobj-cpp.
@freboat Will you submit pull request? Your contribution is more than welcome :)
from libpmemobj-cpp.
Related Issues (20)
- [doc] Update comments in atomic_persistent_aware_ptr to hide implementation details HOT 1
- gcc-12 radix_tree fail: no decltype matches HOT 7
- redefinitions in ebr.hpp
- libpmemobj-cpp as a cmake submodule HOT 1
- make error! HOT 9
- Valgrind not found, but flag TESTS_USE_VALGRIND was set. HOT 6
- fails to build with tbb→onetbb
- concurrent_hash_map HOT 6
- Read garbled code HOT 6
- using hashmap_type = concurrent_hash_map<string, p<int>>; HOT 3
- Why do not make install? HOT 3
- concurrent_hash_map HOT 3
- pmem::transaction_out_of_memory HOT 6
- ndctl create-namespace HOT 3
- avx access beyond end of string HOT 1
- Possible atomic_persistent_aware_ptr_pmreorder failures with FullReorder engine
- radix-tree HOT 3
- Can it be used and built with Mingw64 in MSYS2 HOT 2
- Does libpmemobj or libpmemobj-cpp support dev-dax mode? HOT 5
- multiple definition of pmem::detail::ebr HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libpmemobj-cpp.