Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template<typename T>
- struct storage_trait {
- static const bool value = false;
- };
- template<>
- struct storage_trait<Storage> {
- static const bool value = true;
- };
- template<>
- struct storage_trait<FileStorage> {
- static const bool value = true;
- };
- template<class T>
- constexpr bool is_storage = storage_trait<T>::value;
- template<class T, bool storage = is_storage<T>>
- class MessageQueue {};
- template<class T>
- class MessageQueue<T, true> {
- // generic implementation
- };
- template<>
- class MessageQueue<FileStorage, is_storage<FileStorage>>: public MessageQueue<T, true> {
- // filestorage implementation
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement