<commit_before>//
// file : constructor_call.hpp
// in : file:///home/tim/projects/nsched/nsched/tools/constructor_call.hpp
//
// created by : <NAME> on linux.site
// date: 24/07/2014 12:15:02
//
//
// Copyright (C) 2014 <NAME>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//

#ifndef __N_333063978185995303_2133399434__CONSTRUCTOR_CALL_HPP__
# define __N_333063978185995303_2133399434__CONSTRUCTOR_CALL_HPP__

//
// constructor::call: allow embedding object definitions in templates. (also: works recursively).
// exemple: my_class0<N_EMBED_OBJECT(my_class1, N_EMBED_OBJECT(my_class2, N_EMBED(1), N_EMBED(10), N_EMBED(1)), N_EMBED(13))> my_obj;
// for my_class1::my_class1(const my_class2 &, int) and my_class2::my_class2(int, int, double)
// also works for constexpr and non-constexpr constructors.
//

namespace neam
{
  namespace ct
  {
    // allow to embed an object in a template
    // their is absolutely no overhead at runtime: the assembly code is *exactly* the same as if the constructor has been called directly.
    // to works with 'neam::embed', simply use the 'embed' nested class (or cr_embed if the class doesn't meet the constexpr requirement).
    template<typename ObjectType, typename... Values>
    struct constructor
    {
      struct call       // could be also used in place of 'embed' (when cast isn't needed)
      {
        constexpr call(){}

        // cast to ObjectType (by calling the constructor)
        inline constexpr operator ObjectType()
        {
          return ObjectType(Values::get()...);
        }<commit_msg>[NEAM/TOOLS]: added ct_list.hpp include in constructor_call.hpp<commit_after>//
// file : constructor_call.hpp
// in : file:///home/tim/projects/nsched/nsched/tools/constructor_call.hpp
//
// created by : <NAME> on linux.site
// date: 24/07/2014 12:15:02
//
//
// Copyright (C) 2014 <NAME>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//

#ifndef __N_333063978185995303_2133399434__CONSTRUCTOR_CALL_HPP__
# define __N_333063978185995303_2133399434__CONSTRUCTOR_CALL_HPP__

//
// constructor::call: allow embedding object definitions in templates. (also: works recursively).
// exemple: my_class0<N_EMBED_OBJECT(my_class1, N_EMBED_OBJECT(my_class2, N_EMBED(1), N_EMBED(10), N_EMBED(1)), N_EMBED(13))> my_obj;
// for my_class1::my_class1(const my_class2 &, int) and my_class2::my_class2(int, int, double)
// also works for constexpr and non-constexpr constructors.
//

#include <tools/ct_list.hpp>

namespace neam
{
  namespace ct
  {
    // allow to embed an object in a template
    // their is absolutely no overhead at runtime: the assembly code is *exactly* the same as if the constructor has been called directly.
    // to works with 'neam::embed', simply use the 'embed' nested class (or cr_embed if the class doesn't meet the constexpr requirement).
    template<typename ObjectType, typename... Values>
    struct constructor
    {
      struct call       // could be also used in place of 'embed' (when cast isn't needed)
      {
        constexpr call(){}

        // cast to ObjectType (by calling the constructor)
        inline constexpr operator ObjectType()
        {
          return ObjectType(Values::get()...);
        }
{'fraction_non_alphanumeric': 0.09740545294635004, 'fraction_numerical': 0.04397537379067722, 'mean_word_length': 3.4510763209393347, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, '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': '3472458', 'n_tokens_mistral': 1457, 'n_tokens_neox': 1310, 'n_words': 519}