mirror of
https://github.com/Lime3DS/Lime3DS
synced 2024-12-26 09:02:44 -06:00
Merge pull request #1145 from lioncash/cast
common: Get rid of a cast in swap.h
This commit is contained in:
commit
8c573218b1
1 changed files with 2 additions and 2 deletions
|
@ -148,7 +148,7 @@ struct swap_struct_t {
|
||||||
typedef swap_struct_t<T, F> swapped_t;
|
typedef swap_struct_t<T, F> swapped_t;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
T value;
|
T value = T();
|
||||||
|
|
||||||
static T swap(T v) {
|
static T swap(T v) {
|
||||||
return F::swap(v);
|
return F::swap(v);
|
||||||
|
@ -158,7 +158,7 @@ public:
|
||||||
return swap(value);
|
return swap(value);
|
||||||
|
|
||||||
}
|
}
|
||||||
swap_struct_t() : value((T)0) {}
|
swap_struct_t() = default;
|
||||||
swap_struct_t(const T &v): value(swap(v)) {}
|
swap_struct_t(const T &v): value(swap(v)) {}
|
||||||
|
|
||||||
template <typename S>
|
template <typename S>
|
||||||
|
|
Loading…
Reference in a new issue