TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
ttkany.cpp
Go to the documentation of this file.
1 #include "ttkany.h"
2 
3 TTKAny::TTKAny() noexcept
4  : m_type(std::type_index(typeid(void)))
5 {
6 
7 }
8 
9 TTKAny::TTKAny(const TTKAny &other) noexcept
10  : m_ptr(other.clone())
11  , m_type(other.m_type)
12 {
13 
14 }
15 
16 TTKAny::TTKAny(TTKAny &&other) noexcept
17  : m_ptr(std::move(other.m_ptr))
18  , m_type(std::move(other.m_type))
19 {
20 
21 }
22 
23 bool TTKAny::isNull() const noexcept
24 {
25  return !bool(m_ptr);
26 }
27 
28 TTKAny& TTKAny::operator=(const TTKAny &other) noexcept
29 {
30  if(m_ptr == other.m_ptr)
31  {
32  return *this;
33  }
34 
35  m_ptr = other.clone();
36  m_type = other.m_type;
37  return *this;
38 }
TTKAny & operator=(const TTKAny &other) noexcept
Definition: ttkany.cpp:28
_BasePtr clone() const noexcept
Definition: ttkany.h:131
Definition: ttkcompat.h:39
_BasePtr m_ptr
Definition: ttkany.h:136
The class of the ttk any module.
Definition: ttkany.h:30
bool isNull() const noexcept
Definition: ttkany.cpp:23
#define const
Definition: zconf.h:233
TTKAny() noexcept
Definition: ttkany.cpp:3