tg2sip/tg2sip/utils.h

31 lines
1021 B
C
Raw Normal View History

2018-10-04 07:07:36 +00:00
/*
* Copyright (C) 2017-2018 infactum (infactum@gmail.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef TG2SIP_UTILS_H
#define TG2SIP_UTILS_H
#include <memory>
bool is_digits(const std::string &str);
template<class ToT, class FromT>
std::unique_ptr<ToT> move_unique_ptr_as(std::unique_ptr<FromT> &from) {
return std::unique_ptr<ToT>(static_cast<ToT *>(from.release()));
}
#endif //TG2SIP_UTILS_H