Browse Source

* small changes and fixes

master
bergmann 5 years ago
parent
commit
eba1c0e7b8
4 changed files with 22 additions and 10 deletions
  1. +12
    -5
      include/cpputils/container/nullable.h
  2. +7
    -2
      include/cpputils/mp/core/checker.h
  3. +2
    -2
      include/cpputils/mp/core/modifier.h
  4. +1
    -1
      src/CMakeLists.txt

+ 12
- 5
include/cpputils/container/nullable.h View File

@@ -107,19 +107,26 @@ namespace utl
&& value() < other.value();
}

inline void operator=(value_type&& t)
{ _container.reset(new container(std::forward<value_type>(t))); }
inline decltype(auto) operator=(value_type&& t)
{
_container.reset(new container(std::forward<value_type>(t)));
return *this;
}

inline void operator=(const nullable& other)
inline decltype(auto) operator=(const nullable& other)
{
if (other.has_value())
*this = other.value();
else
reset();
return *this;
}

inline void operator=(nullable&& other)
{ _container = std::move(other._container); }
inline decltype(auto) operator=(nullable&& other)
{
_container = std::move(other._container);
return *this;
}





+ 7
- 2
include/cpputils/mp/core/checker.h View File

@@ -18,12 +18,12 @@ namespace mp {

template<typename T, template <typename...> class T_template>
struct is_specialization_of_impl
: c_false_t
: public c_false_t
{ };

template<template <typename...> class T_template, typename... Ts>
struct is_specialization_of_impl<T_template<Ts...>, T_template>
: c_true_t
: public c_true_t
{ };

}
@@ -73,6 +73,11 @@ namespace mp {
c_bool_t<std::is_arithmetic<T>::value>
{ };

template<typename T>
struct is_integral :
c_bool_t<std::is_integral<T>::value>
{ };

template<typename T>
struct is_signed :
c_bool_t<std::is_signed<T>::value>


+ 2
- 2
include/cpputils/mp/core/modifier.h View File

@@ -40,10 +40,10 @@ namespace mp {
using decay = __impl::decay_impl<T>;

template<class T>
using decay_type = typename __impl::decay_impl<T>::type;
using decay_t = typename __impl::decay_impl<T>::type;

template<typename T, typename U>
using common_type = __impl::common_type_impl<T, U>;
using common_t = __impl::common_type_impl<T, U>;

namespace __impl /* implementation */
{


+ 1
- 1
src/CMakeLists.txt View File

@@ -23,6 +23,6 @@ Target_Include_Directories (
If ( __COTIRE_INCLUDED )
Cotire ( cpputils )
EndIf ( )
If ( __STRIP_SYMBOLS_INCLUDED )
If ( __STRIP_SYMBOLS_INCLUDED AND BUILD_SHARED_LIBS )
Strip_Symbols ( cpputils DBG_FILE )
EndIf ()

Loading…
Cancel
Save