LeechCraft  0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
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 
13 QTEST_MAIN (LC::Util::DetectorTest)
14 
15 namespace LC
16 {
17 namespace 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 
34  static_assert (IsDetected_v<DoSmthDetector, Foo>);
35  static_assert (!IsDetected_v<DoSmthDetector, Bar>);
36  }
37 }
38 }
LC::Util::DoSmthDetector
decltype(std::declval< T >().DoSmth(QString {})) DoSmthDetector
Definition: detectortest.cpp:32
LC
Definition: constants.h:14
detector.h
LC::Util::DetectorTest
Definition: detectortest.h:29
detectortest.h