/* * Copyright 2017 Axel Waggershauser */ // SPDX-License-Identifier: Apache-2.0 #pragma once #include "Error.h" #include #include #include #include #include #include #include namespace ZXing { template constexpr T narrow_cast(U&& u) noexcept { return static_cast(std::forward(u)); } template auto Find(Container& c, const Value& v) -> decltype(std::begin(c)) { return std::find(std::begin(c), std::end(c), v); } template auto FindIf(Container& c, Predicate p) -> decltype(std::begin(c)) { return std::find_if(std::begin(c), std::end(c), p); } template auto Contains(const Container& c, const Value& v) -> decltype(std::begin(c), bool()){ return Find(c, v) != std::end(c); } template auto Contains(const std::initializer_list& c, const Value& v) -> decltype(std::begin(c), bool()){ return Find(c, v) != std::end(c); } inline bool Contains(const char* str, char c) { return strchr(str, c) != nullptr; } template