Last active
August 29, 2018 12:09
-
-
Save kheaactua/251310d109dc80cd3a983824bd72d30c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <queue> | |
#include <boost/tti/has_member_function.hpp> | |
BOOST_TTI_HAS_MEMBER_FUNCTION(notify_exit) | |
template<typename Data> | |
class QueueB | |
{ | |
public: | |
auto notify_exit() -> void; | |
}; | |
template <typename Queue> | |
class MyQueue | |
{ | |
public: | |
auto notify_exit() -> typename std::enable_if< | |
has_member_function_notify_exit<Queue, void>::value, | |
void | |
>::type; | |
Queue queue_a; | |
}; | |
auto main(int argc, char *argv[]) -> int | |
{ | |
MyQueue<std::queue<int>> queue_a; | |
std::cout << "std::queue has notify_exit? " << (has_member_function_notify_exit<std::queue<int>, void>::value ? "yes" : "no") << std::endl; | |
std::cout << "QueueB has notify_exit? " << (has_member_function_notify_exit<QueueB<int>, void>::value ? "yes" : "no") << std::endl; | |
} | |
/* vim: set ts=4 sw=4 sts=4 expandtab ffs=unix,dos : */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CXX = clang++ | |
boost_base := ${HOME}/.conan/data/boost/1.60.0/ntc/stable/package/3de93f54463683a59d0674ac75727b8457727fc8 | |
all: | |
${CXX} -o example -L${boost_base}/lib -I${boost_base}/include example.cpp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment