LeechCraft 0.6.70-17335-ge406ffdcaf
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
detectortest.cpp
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#include "detectortest.h"
10#include <QtTest>
11#include <detector.h>
12
13QTEST_MAIN (LC::Util::DetectorTest)
14
15namespace LC
16{
17namespace Util
18{
19 template<typename T>
20 using DoSmthDetector = decltype (std::declval<T> ().DoSmth (QString {}));
21
22 void DetectorTest::testDetectMember ()
23 {
24 struct Foo
25 {
26 int DoSmth (const QString&);
27 };
28
29 struct Bar
30 {
31 void DoSmth (int);
32 };
33
35 static_assert (!IsDetected_v<DoSmthDetector, Bar>);
36 }
37}
38}
constexpr bool IsDetected_v
Definition detector.h:35
decltype(std::declval< T >().DoSmth(QString {})) DoSmthDetector
Definition constants.h:15