add is_string security

This commit is contained in:
chatlanin
2022-06-29 12:36:48 +03:00
parent bb49c6f96b
commit 7ec159ac5f
3 changed files with 26 additions and 0 deletions

View File

@@ -2,6 +2,7 @@
namespace hack::range
{
// являются ли числа максимум и минимум последовательности
template<typename T, typename... Args>
bool within(const T min, const T max, Args... args)
{

View File

@@ -0,0 +1,14 @@
#pragma once
#include <string>
#include <variant>
#include <type_traits>
namespace hack::security
{
template<typename T>
struct is_string : public std::disjunction<
std::is_same<char*, typename std::decay_t<T>>,
std::is_same<const char*, typename std::decay_t<T>>,
std::is_same<std::string, typename std::decay_t<T>>> {};
}