mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
feat(MainDb): exec on SafeTransaction is now constexpr
This commit is contained in:
parent
cefa3cb85a
commit
68bb9a1224
1 changed files with 4 additions and 2 deletions
|
|
@ -120,14 +120,16 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
// Exec function with no return type.
|
||||
template<typename T>
|
||||
typename std::enable_if<std::is_same<T, void>::value, bool>::type exec () const {
|
||||
constexpr typename std::enable_if<std::is_same<T, void>::value, bool>::type exec () const {
|
||||
mFunction();
|
||||
return true;
|
||||
}
|
||||
|
||||
// Exec function with return type.
|
||||
template<typename T>
|
||||
typename std::enable_if<!std::is_same<T, void>::value, T>::type exec () const {
|
||||
constexpr typename std::enable_if<!std::is_same<T, void>::value, T>::type exec () const {
|
||||
return mFunction();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue