<commit_before>// Version: $Id$
//
//

// Commentary:
//
//

// Change Log:
//
//

// Code:

#pragma once

#include <cstring>

// ///////////////////////////////////////////////////////////////////
// dtkStaticArrayData interface
// ///////////////////////////////////////////////////////////////////

template < typename T, size_t Alignment, qlonglong Size, bool = std::is_pod<T>::value > struct dtkStaticArrayData
{
    T _data[Size];

    const T *data(void) const { return _data; }
          T *data(void)       { return _data; }
};

template < typename T, size_t Alignment > struct dtkStaticArrayData <T, Alignment, 0, false>
{
    const T *data(void) const { return NULL; }
          T *data(void)       { return NULL; }
};

template < typename T, size_t Alignment, qlonglong Size > struct dtkStaticArrayData<T, Alignment, Size, true>
{
#ifndef Q_CC_MSVC
    alignas(Alignment) T _data[Size];
#else
    Q_DECL_ALIGN(Alignment) T _data[Size];
#endif
    const T *data(void) const { return _data; }
          T *data(void)       { return _data; }
};

template < typename T, size_t Alignment > struct dtkStaticArrayData <T, Alignment, 0, true>
{
    const T *data(void) const { return NULL; }
          T *data(void)       { return NULL; }
};

// ///////////////////////////////////////////////////////////////////
// dtkStaticArray interface
// ///////////////////////////////////////////////////////////////////

template < typename T, qlonglong Size, size_t Alignment = std::alignment_of<T>::value > class dtkStaticArray
{
public:
    dtkStaticArrayData<T, Alignment, Size> d;

public:<commit_msg>Remove alignment when compiling with MSVC.<commit_after>// Version: $Id$
//
//

// Commentary:
//
//

// Change Log:
//
//

// Code:

#pragma once

#include <cstring>

// ///////////////////////////////////////////////////////////////////
// dtkStaticArrayData interface
// ///////////////////////////////////////////////////////////////////

template < typename T, size_t Alignment, qlonglong Size, bool = std::is_pod<T>::value > struct dtkStaticArrayData
{
    T _data[Size];

    const T *data(void) const { return _data; }
          T *data(void)       { return _data; }
};

template < typename T, size_t Alignment > struct dtkStaticArrayData <T, Alignment, 0, false>
{
    const T *data(void) const { return NULL; }
          T *data(void)       { return NULL; }
};

template < typename T, size_t Alignment, qlonglong Size > struct dtkStaticArrayData<T, Alignment, Size, true>
{
#ifndef Q_CC_MSVC
    alignas(Alignment) T _data[Size];
#else
    T _data[Size];
#endif
    const T *data(void) const { return _data; }
          T *data(void)       { return _data; }
};

template < typename T, size_t Alignment > struct dtkStaticArrayData <T, Alignment, 0, true>
{
    const T *data(void) const { return NULL; }
          T *data(void)       { return NULL; }
};

// ///////////////////////////////////////////////////////////////////
// dtkStaticArray interface
// ///////////////////////////////////////////////////////////////////

template < typename T, qlonglong Size, size_t Alignment = std::alignment_of<T>::value > class dtkStaticArray
{
public:
    dtkStaticArrayData<T, Alignment, Size> d;

public:
{'fraction_non_alphanumeric': 0.2768607910308315, 'fraction_numerical': 0.0012457178449081284, 'mean_word_length': 1.6946308724832215, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '5259325', 'n_tokens_mistral': 944, 'n_tokens_neox': 919, 'n_words': 259}