<commit_before>// Copyright 2015-2019 <NAME>. All rights reserved.

#ifndef OUZEL_MATH_SIZE_HPP
#define OUZEL_MATH_SIZE_HPP

#include <cstddef>
#include <type_traits>
#include "math/Vector.hpp"

namespace ouzel
{
    template <size_t N, class T> class Size final
    {
    public:
        T v[N]{0};

        constexpr Size() {}

        template <typename ...A>
        constexpr Size(A... args) noexcept:
            v{static_cast<T>(args)...}
        {
        }

        template <size_t X = N, size_t N2, typename std::enable_if<(X != N2)>::type* = nullptr>
        explicit Size(const Size<N2, T>& size) noexcept
        {
            for (size_t i = 0; i < N && i < N2; ++i)
                v[i] = size.v[i];
        }

        explicit Size(const Vector<N, T>& vec) noexcept:
            v(vec.v)
        {
        }

        T& operator[](size_t index) noexcept { return v[index]; }
        constexpr T operator[](size_t index) const noexcept { return v[index]; }

        template <size_t X = N, typename std::enable_if<(X >= 1)>::type* = nullptr>
        T& width() noexcept { return v[0]; }

        template <size_t X = N, typename std::enable_if<(X >= 1)>::type* = nullptr>
        constexpr T width() const noexcept { return v[0]; }

        template <size_t X = N, typename std::enable_if<(X >= 2)>::type* = nullptr><commit_msg>Make the constructor of Size noexcept<commit_after>// Copyright 2015-2019 <NAME>. All rights reserved.

#ifndef OUZEL_MATH_SIZE_HPP
#define OUZEL_MATH_SIZE_HPP

#include <cstddef>
#include <type_traits>
#include "math/Vector.hpp"

namespace ouzel
{
    template <size_t N, class T> class Size final
    {
    public:
        T v[N]{0};

        constexpr Size() noexcept {}

        template <typename ...A>
        constexpr Size(A... args) noexcept:
            v{static_cast<T>(args)...}
        {
        }

        template <size_t X = N, size_t N2, typename std::enable_if<(X != N2)>::type* = nullptr>
        explicit Size(const Size<N2, T>& size) noexcept
        {
            for (size_t i = 0; i < N && i < N2; ++i)
                v[i] = size.v[i];
        }

        explicit Size(const Vector<N, T>& vec) noexcept:
            v(vec.v)
        {
        }

        T& operator[](size_t index) noexcept { return v[index]; }
        constexpr T operator[](size_t index) const noexcept { return v[index]; }

        template <size_t X = N, typename std::enable_if<(X >= 1)>::type* = nullptr>
        T& width() noexcept { return v[0]; }

        template <size_t X = N, typename std::enable_if<(X >= 1)>::type* = nullptr>
        constexpr T width() const noexcept { return v[0]; }

        template <size_t X = N, typename std::enable_if<(X >= 2)>::type* = nullptr>
{'fraction_non_alphanumeric': 0.1447997059904447, 'fraction_numerical': 0.01396545387725101, 'mean_word_length': 2.2914147521160824, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6395064', 'n_tokens_mistral': 964, 'n_tokens_neox': 913, 'n_words': 253}