Comments (9)
Hmm, that is ugly. An old GCC 4.2 with a modern LLVM backend. I'll have to think about that.
Shouldn't it be !defined(__APPLE__) && (...)
though?
from concurrentqueue.
I fixed it with this:
namespace std
{
template<typename> struct has_trivial_destructor;
template<typename> struct is_trivially_destructible;
}
namespace Freebird_cxx11_trait_util
{
template<typename T>
class have_cxx11_trait_helper
{
template<typename T2, bool = std::is_trivially_destructible<T2>::type::value>
static std::true_type test(int);
template<typename T2, bool = std::has_trivial_destructor<T2>::type::value>
static std::false_type test(...);
public:
typedef decltype(test<T>(0)) type;
};
template<typename T>
struct have_cxx11_trait : have_cxx11_trait_helper<T>::type
{ };
}
// ....
template<typename It>
static inline auto deref_noexcept(It& it) MOODYCAMEL_NOEXCEPT -> decltype(*it)
{
return *it;
}
template<typename T>
using is_trivially_destructible
= typename std::conditional<
Freebird_cxx11_trait_util::have_cxx11_trait<T>::value,
std::is_trivially_destructible<T>,
std::has_trivial_destructor<T>
>::type;
#ifdef MOODYCAMEL_CPP11_THREAD_LOCAL_SUPPORTED
which can be found on Stackoverflow
from concurrentqueue.
I've committed your original macro-based fix for now (you were right about the condition, by the way, I was mixing up the two lines). I'm not sure how slightly older compilers will react to the template wizardry involved in the second one (somebody commented on that SO question that it's broken on clang 3.1).
Thanks for reporting this, and for the fixes! Much appreciated.
from concurrentqueue.
./concurrentqueue.hpp:396:70: error: no template named 'has_trivial_destructor' in namespace 'std'; did you mean 'has_virtual_destructor'?
template struct is_trivially_destructible : std::has_trivial_destructor { };
~~~~~^~~~~~~~~~~~~~~~~~~~~~
has_virtual_destructor
/usr/include/c++/v1/type_traits:971:51: note: 'has_virtual_destructor' declared here
template struct _LIBCPP_TYPE_VIS_ONLY has_virtual_destructor
^
1 error generated.
clang++ --version
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target: x86_64-unknown-freebsd10.1
Thread model: posix
from concurrentqueue.
Seems the error came back to haunt us? I'll look into this shortly, thanks for the report.
from concurrentqueue.
Sorry about that. It should be fixed now. Obviously the GCC version detection doesn't work very well with clang because it defines the GCC macros (but isn't bug-for-bug compatible).
from concurrentqueue.
@cameron314 sorry for reopen this issue, there is no necessary to use __APPLE__
and __clang__
they both, because in OSX 10.10.x, even I use gcc to compile those files, the macro __clang__
also has been defined.
At first, I use __APPLE__
is because of I have no FreeBSD and I am not sure the situation may be different in another clang compiler.
Maybe you can just remove the first __APPLE__
and just write as
#if defined(__clang__) || !defined(__GNUC__) .|| some others
It is not a bug, I just think this may seems more beautiful.
from concurrentqueue.
Hmm, yep, makes sense. The gcc on Mac OS X must simply be a wrapper around clang. Thanks for the pull request!
from concurrentqueue.
My pleasure, your code is really useful and make some contribution for this project is also means help myself.
from concurrentqueue.
Related Issues (20)
- error C2129: static function 'bool moodycamel::details::likely(bool)' declared but not defined HOT 6
- possible race condtion in accessing object in shared_ptr if share_ptr is the template type for concurrentqueue? HOT 2
- concurrentqueue and readerwriterqueue,which one has better performance? HOT 5
- EXPLICIT_INITIAL_INDEX_SIZE not working HOT 13
- How to use token in multi producers and multi consumers situation? HOT 1
- Zero-copy support HOT 4
- Release queue memory without calling destructors HOT 2
- How to force fully remove the remaining data. HOT 4
- Question: Does this build and run on QNX ? HOT 2
- Memory Leak? HOT 2
- Memory Leak HOT 6
- [feature-request] Associating ProducerToken & ConsumerToken explicitly
- segment fault
- Occasionally program can be stuck inside try_dequeue of blockingconcurrentqueue.h HOT 1
- installed concurrentqueue using vcpkg, but can not make.
- try_dequeue_bulk core dump. HOT 2
- Introducing LIFO semaphore
- Waiting without dequeuing HOT 1
- ConcurrentQueue ~150x slower on Windows HOT 11
- Naming conflict HOT 2
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 concurrentqueue.