OGLplus  (0.59.0) a C++ wrapper for rendering APIs

interface.hpp
Go to the documentation of this file.
1 
9 #ifndef EAGINE_INTERFACE_HPP
10 #define EAGINE_INTERFACE_HPP
11 
12 namespace eagine {
13 
17 template <typename Derived>
18 class interface {
19 public:
21  constexpr interface(const interface&) = delete;
22 
24  auto operator=(interface&&) = delete;
25 
27  auto operator=(const interface&) = delete;
28 
29 protected:
31  constexpr interface() noexcept = default;
32 
34  constexpr interface(interface&&) noexcept = default;
35  virtual ~interface() noexcept = default;
36 };
37 
41 template <typename Derived>
42 class abstract {
43 protected:
45  constexpr abstract() noexcept = default;
46 
48  constexpr abstract(abstract&&) noexcept = default;
49 
51  constexpr abstract(const abstract&) noexcept = default;
52 
54  auto operator=(abstract&&) noexcept -> abstract& = default;
55 
57  auto operator=(const abstract&) noexcept -> abstract& = default;
58  virtual ~abstract() noexcept = default;
59 };
60 
61 } // namespace eagine
62 
63 #endif // EAGINE_INTERFACE_HPP
Common code is placed in this namespace.
Definition: eagine.hpp:21
auto operator=(abstract &&) noexcept -> abstract &=default
Move assignable by derived.
Base template for abstract interfaces, implements common functionality.
Definition: interface.hpp:18
Base template for polymorphic classes, implements common functionality.
Definition: interface.hpp:42
constexpr interface() noexcept=default
Default constructible by derived.
auto operator=(interface &&)=delete
Not move assignable.

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).