File tree Expand file tree Collapse file tree 3 files changed +46
-75
lines changed
include/lsp-plug.in/common Expand file tree Collapse file tree 3 files changed +46
-75
lines changed Original file line number Diff line number Diff line change 55=== 1.0.45 ===
66* Added strend() function for returning pointer to the end of C string.
77* Added strmemdup() function for converting sequence of bytes to C string.
8+ * Moved all definitions from <variadic.h> to <types.h>.
9+ * Removed <variadic.h>.
810
911=== 1.0.44 ===
1012* Some improvement around endianess conversion functions.
Original file line number Diff line number Diff line change @@ -906,16 +906,55 @@ namespace lsp
906906// Library exports, for built-in modules there are no exports
907907namespace lsp
908908{
909+ // lsp::remove_reference
909910 template <class T >
910- inline void swap (T &a, T &b)
911+ struct remove_reference
911912 {
912- T tmp = a;
913- a = b;
914- b = tmp;
913+ typedef T type;
914+ };
915+
916+ template <class T >
917+ struct remove_reference <T&>
918+ {
919+ typedef T type;
920+ };
921+
922+ template <class T >
923+ struct remove_reference <T&&>
924+ {
925+ typedef T type;
926+ };
927+
928+ // lsp::move
929+ template <typename T>
930+ typename remove_reference<T>::type && move(T && t) noexcept
931+ {
932+ return static_cast <typename remove_reference<T>::type &&>(t);
933+ }
934+
935+ // lsp::forward
936+ template <typename T>
937+ constexpr T && forward(typename remove_reference<T>::type && args) noexcept
938+ {
939+ return static_cast <T &&>(args);
940+ }
941+
942+ template <typename T>
943+ constexpr T && forward(typename remove_reference<T>::type & args) noexcept
944+ {
945+ return static_cast <T &&>(args);
946+ }
947+
948+ template <class T >
949+ inline void swap (T & a, T & b) noexcept
950+ {
951+ T tmp = lsp::move (a);
952+ a = lsp::move (b);
953+ b = lsp::move (tmp);
915954 }
916955
917956 template <class T >
918- inline T *release (T * &a)
957+ inline T *release (T * &a) noexcept
919958 {
920959 T *tmp = a;
921960 a = NULL ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments