<commit_before>/// @file
/// @author uentity
/// @date 12.01.2016
/// @brief 
/// @copyright
/// This Source Code Form is subject to the terms of the Mozilla Public License,
/// v. 2.0. If a copy of the MPL was not distributed with this file,
/// You can obtain one at https://mozilla.org/MPL/2.0/

#pragma once

#include "vecbase.h"
#include "vecbase_shared.h"
#include "../type_descriptor.h"
#include "../type_macro.h"
#include "../objbase.h"
#include <vector>

#if !defined(BS_ARRAY_DEFAULT_TRAITS)
#define BS_ARRAY_DEFAULT_TRAITS vector_traits
#endif

namespace blue_sky {

/// @brief traits for arrays with std::vector container
template< class T >
struct BS_API vector_traits : public bs_vecbase_impl< T, std::vector< T > > {};

/*-----------------------------------------------------------------------------
 *  bs_array - BlueSky class to choose arrbase_impl or vecbase_impl for different containers
 *-----------------------------------------------------------------------------*/
/// @brief Contains array of key-value pairs with integral key (index)
///
/// bs_array expects std::vector-like syntax of container in traits
/// template params:
///           T -- type of array elements
/// cont_traits -- specifies underlying container
template< class T, template< class > class cont_traits = BS_ARRAY_DEFAULT_TRAITS >
class BS_API bs_array : public cont_traits< T >::bs_array_base, public objbase {
public:
	// traits
	using cont_traits_t = cont_traits< T >;
	using base_t    = typename cont_traits_t::bs_array_base;
	using arrbase   = typename cont_traits_t::arrbase;
	using container = typename cont_traits_t::container;

	using typename arrbase::sp_arrbase;
	using sp_array = std::shared_ptr< bs_array >;

	// inherited from bs_arrbase class
	using typename arrbase::value_type;
	using typename arrbase::key_type;
	using typename arrbase::size_type;

	using typename arrbase::pointer;
	using typename arrbase::reference;
	using typename arrbase::const_pointer;
	using typename arrbase::const_reference;
	using typename arrbase::iterator;
	using typename arrbase::const_iterator;
	using typename arrbase::reverse_iterator;
	using typename arrbase::const_reverse_iterator;

	using arrbase::assign;

	bs_array() = default;
	bs_array(const bs_array&) = default;<commit_msg>compat.array: fix abmiguity in resolving typedefs in bs_array<commit_after>/// @file
/// @author uentity
/// @date 12.01.2016
/// @brief 
/// @copyright
/// This Source Code Form is subject to the terms of the Mozilla Public License,
/// v. 2.0. If a copy of the MPL was not distributed with this file,
/// You can obtain one at https://mozilla.org/MPL/2.0/

#pragma once

#include "vecbase.h"
#include "vecbase_shared.h"
#include "../type_descriptor.h"
#include "../type_macro.h"
#include "../objbase.h"
#include <vector>

#if !defined(BS_ARRAY_DEFAULT_TRAITS)
#define BS_ARRAY_DEFAULT_TRAITS vector_traits
#endif

namespace blue_sky {

/// @brief traits for arrays with std::vector container
template< class T >
struct BS_API vector_traits : public bs_vecbase_impl< T, std::vector< T > > {};

/*-----------------------------------------------------------------------------
 *  bs_array - BlueSky class to choose arrbase_impl or vecbase_impl for different containers
 *-----------------------------------------------------------------------------*/
/// @brief Contains array of key-value pairs with integral key (index)
///
/// bs_array expects std::vector-like syntax of container in traits
/// template params:
///           T -- type of array elements
/// cont_traits -- specifies underlying container
template< class T, template< class > class cont_traits = BS_ARRAY_DEFAULT_TRAITS >
class BS_API bs_array : public cont_traits< T >::bs_array_base, public objbase {
public:
	// traits
	using cont_traits_t = cont_traits< T >;
	using base_t    = typename cont_traits_t::bs_array_base;
	using arrbase   = typename cont_traits_t::arrbase;
	using container = typename cont_traits_t::container;

	using sp_arrbase = typename arrbase::sp_arrbase;
	using sp_array   = std::shared_ptr< bs_array >;

	// inherited from bs_arrbase class
	using value_type = typename arrbase::value_type;
	using key_type   = typename arrbase::key_type;
	using size_type  = typename arrbase::size_type;

	using pointer                = typename arrbase::pointer;
	using reference              = typename arrbase::reference;
	using const_pointer          = typename arrbase::const_pointer;
	using const_reference        = typename arrbase::const_reference;
	using iterator               = typename arrbase::iterator;
	using const_iterator         = typename arrbase::const_iterator;
	using reverse_iterator       = typename arrbase::reverse_iterator;
	using const_reverse_iterator = typename arrbase::const_reverse_iterator;

	using arrbase::assign;

	bs_array() = default;
	bs_array(const bs_array&) = default;
{'fraction_non_alphanumeric': 0.16105176663927692, 'fraction_numerical': 0.0049301561216105174, 'mean_word_length': 3.0984848484848486, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 2, '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': '2468663', 'n_tokens_mistral': 1467, 'n_tokens_neox': 1360, 'n_words': 434}