<commit_before>#ifndef SAUCE_SAUCE_BINDER_H_
#define SAUCE_SAUCE_BINDER_H_

#include <memory>
#include <utility>

#include <sauce/internal/binding.h>
#include <sauce/internal/clause.h>
#include <sauce/internal/bindings/all.h>

namespace sauce {

template<typename Iface, typename Ctor>
class To;

/**
 * Binds to a specific constructor and allocator.
 */
template<typename Iface, typename Ctor, typename Allocator>
class AllocateFrom:
  public i::Clause<AllocateFrom<Iface, Ctor, Allocator> > {

  friend class To<Iface, Ctor>;
  friend class i::Clause<AllocateFrom<Iface, Ctor, Allocator> >;

  AllocateFrom(i::BindingMap & bindingMap):
    i::Clause<AllocateFrom<Iface, Ctor, Allocator> >(bindingMap) {}

  static void activate(i::BindingMap & bindingMap) {
    i::BindingPointer binding(new b::New<Iface, Ctor, Allocator>());
    bindingMap.insert(std::make_pair(binding->getKey(), binding));
  }
};

template<typename Iface>
class Bind;

/**
 * Binds to a specific constructor allocating from the heap.
 */
template<typename Iface, typename Ctor>
class To:
  public i::Clause<To<Iface, Ctor> > {

  friend class Bind<Iface>;
  friend class i::Clause<To<Iface, Ctor> >;

  To(i::BindingMap & bindingMap):
    i::Clause<To<Iface, Ctor> >(bindingMap) {}

  static void activate(i::BindingMap & bindingMap) {
    i::BindingPointer binding(new b::New<Iface, Ctor, std::allocator<Iface> >());
    bindingMap.insert(std::make_pair(binding->getKey(), binding));
  }

public:

  template<typename Allocator>
  AllocateFrom<Iface, Ctor, Allocator> allocateFrom() {
    return AllocateFrom<Iface, Ctor, Allocator>(this->pass());
  }

};

class Binder;

/**
 * A builder that creates a single binding.
 */
template<typename Iface><commit_msg>Dry up To::activate.<commit_after>#ifndef SAUCE_SAUCE_BINDER_H_
#define SAUCE_SAUCE_BINDER_H_

#include <memory>
#include <utility>

#include <sauce/internal/binding.h>
#include <sauce/internal/clause.h>
#include <sauce/internal/bindings/all.h>

namespace sauce {

template<typename Iface, typename Ctor>
class To;

/**
 * Binds to a specific constructor and allocator.
 */
template<typename Iface, typename Ctor, typename Allocator>
class AllocateFrom:
  public i::Clause<AllocateFrom<Iface, Ctor, Allocator> > {

  friend class To<Iface, Ctor>;
  friend class i::Clause<AllocateFrom<Iface, Ctor, Allocator> >;

  AllocateFrom(i::BindingMap & bindingMap):
    i::Clause<AllocateFrom<Iface, Ctor, Allocator> >(bindingMap) {}

  static void activate(i::BindingMap & bindingMap) {
    i::BindingPointer binding(new b::New<Iface, Ctor, Allocator>());
    bindingMap.insert(std::make_pair(binding->getKey(), binding));
  }
};

template<typename Iface>
class Bind;

/**
 * Binds to a specific constructor allocating from the heap.
 */
template<typename Iface, typename Ctor>
class To:
  public i::Clause<To<Iface, Ctor> > {

  friend class Bind<Iface>;
  friend class i::Clause<To<Iface, Ctor> >;

  To(i::BindingMap & bindingMap):
    i::Clause<To<Iface, Ctor> >(bindingMap) {}

  static void activate(i::BindingMap & bindingMap) {
    AllocateFrom<Iface, Ctor, std::allocator<Iface> >::activate(bindingMap);
  }

public:

  template<typename Allocator>
  AllocateFrom<Iface, Ctor, Allocator> allocateFrom() {
    return AllocateFrom<Iface, Ctor, Allocator>(this->pass());
  }

};

class Binder;

/**
 * A builder that creates a single binding.
 */
template<typename Iface>
{'fraction_non_alphanumeric': 0.13870114604760506, 'fraction_numerical': 0.0, 'mean_word_length': 5.3745318352059925, 'pattern_counts': {'":': 0, '<': 63, '<?xml version=': 0, '>': 68, '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': '3269678', 'n_tokens_mistral': 1214, 'n_tokens_neox': 1205, 'n_words': 266}