mirror of
https://gitee.com/an-tao/drogon.git
synced 2024-11-30 02:37:57 +08:00
Use nullopt instead of the no-argument constructor (#1344)
This commit is contained in:
parent
2465753ee9
commit
64b9484657
@ -79,7 +79,7 @@ class Session
|
||||
{
|
||||
if (typeid(T) == it->second.type())
|
||||
{
|
||||
return optional<T>{*(any_cast<T>(&(it->second)))};
|
||||
return *(any_cast<T>(&(it->second)));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -87,7 +87,7 @@ class Session
|
||||
}
|
||||
}
|
||||
}
|
||||
return optional<T>{};
|
||||
return nullopt;
|
||||
}
|
||||
/**
|
||||
* @brief Modify or visit the data identified by the key parameter.
|
||||
|
@ -22,8 +22,10 @@
|
||||
namespace drogon
|
||||
{
|
||||
#if __cplusplus >= 201703L || (defined _MSC_VER && _MSC_VER > 1900)
|
||||
using std::nullopt;
|
||||
using std::optional;
|
||||
#else
|
||||
const boost::none_t nullopt = boost::none;
|
||||
using boost::optional;
|
||||
#endif
|
||||
} // namespace drogon
|
||||
} // namespace drogon
|
||||
|
Loading…
Reference in New Issue
Block a user