chromium/third_party/skia/include/private/base/SkTo.h

/*
 * Copyright 2018 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */
#ifndef SkTo_DEFINED
#define SkTo_DEFINED

#include "include/private/base/SkAssert.h"
#include "include/private/base/SkTFitsIn.h"

#include <cstddef>
#include <cstdint>

template <typename D, typename S> constexpr D SkTo(S s) {}

template <typename S> constexpr int8_t   SkToS8(S x)    {}
template <typename S> constexpr uint8_t  SkToU8(S x)    {}
template <typename S> constexpr int16_t  SkToS16(S x)   {}
template <typename S> constexpr uint16_t SkToU16(S x)   {}
template <typename S> constexpr int32_t  SkToS32(S x)   {}
template <typename S> constexpr uint32_t SkToU32(S x)   {}
template <typename S> constexpr int64_t  SkToS64(S x)   {}
template <typename S> constexpr uint64_t SkToU64(S x)   {}
template <typename S> constexpr int      SkToInt(S x)   {}
template <typename S> constexpr unsigned SkToUInt(S x)  {}
template <typename S> constexpr size_t   SkToSizeT(S x) {}

/** @return false or true based on the condition
*/
template <typename T> static constexpr bool SkToBool(const T& x) {}

#endif  // SkTo_DEFINED