diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-12-20 18:23:14 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-12-24 19:31:24 +0100 |
commit | e81df263f4123a39fe6d4d50fb21f47dd242e796 (patch) | |
tree | 4b8cd13da31ac3fb3a2d2695b65595d7c5570439 /tracker-pt | |
parent | 2613beb8028ecac53548d311b27ff38559763f6c (diff) |
remove const correctness violations
This is possibly related to a livelock where several threads do const
removal in their respective code paths.
Use the `mutable' specifier for the mutexes and spline's cached data.
Now using the `mutable' specifier, get rid of <optional> in
compat/mutex.
Diffstat (limited to 'tracker-pt')
-rw-r--r-- | tracker-pt/pt-api.hpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/tracker-pt/pt-api.hpp b/tracker-pt/pt-api.hpp index 12085560..6c36ebaf 100644 --- a/tracker-pt/pt-api.hpp +++ b/tracker-pt/pt-api.hpp @@ -42,16 +42,13 @@ struct pt_frame : pt_pixel_pos_mixin template<typename t> t* as() & { - using u = remove_cvref_t<t>; - static_assert(std::is_convertible_v<u*, pt_frame*>, "must be derived from pt_frame"); - return static_cast<t*>(this); } template<typename t> t const* as_const() const& { - return const_cast<pt_frame*>(this)->as<const t>(); + return static_cast<t const*>(this); } }; |