File indexing completed on 2024-12-08 12:44:38

0001 /*
0002     SPDX-FileCopyrightText: 2019 Daniel Vrátil <dvratil@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef KASYNC_TRAITS_H_
0008 #define KASYNC_TRAITS_H_
0009 
0010 #include <utility>
0011 
0012 namespace KAsync {
0013 
0014 namespace traits {
0015 
0016 template<typename T, typename = void>
0017 struct isContainer {
0018     enum { value = 0 };
0019 };
0020 
0021 template<typename T>
0022 struct isContainer<T, std::void_t<decltype(std::declval<T&>().begin()),
0023                                   decltype(std::declval<T&>().end()),
0024                                   typename T::value_type>>
0025 {
0026     enum { value = 1 };
0027 };
0028 
0029 
0030 
0031 } // namespace traits
0032 } // namespace KAsync
0033 
0034 #endif