<commit_before>#ifndef ARBITER_REQUIREMENT_INL_H
#define ARBITER_REQUIREMENT_INL_H

#ifndef __cplusplus
#error "This file must be compiled as C++."
#endif

#include "Requirement.h"
#include "Version-inl.h"

#include <memory>

struct ArbiterRequirement
{
  public:
    virtual ~ArbiterRequirement () = default;

    virtual bool satisfiedBy (const ArbiterSemanticVersion &version) const noexcept = 0;

    virtual bool operator== (const ArbiterRequirement &other) const noexcept = 0;

    virtual std::unique_ptr<ArbiterRequirement> clone () const = 0;

    bool operator!= (const ArbiterRequirement &other) const noexcept
    {
      return !(*this == other);
    }
};

namespace Arbiter {
namespace Requirement {

class Any : public ArbiterRequirement
{
  public:
    bool satisfiedBy (const ArbiterSemanticVersion &) const noexcept override
    {
      return true;
    }

    bool operator== (const ArbiterRequirement &other) const noexcept override
    {
      return (bool)dynamic_cast<const Any *>(&other);
    }

    std::unique_ptr<ArbiterRequirement> clone () const override
    {
      return std::make_unique<Any>(*this);
    }
};

class AtLeast : public ArbiterRequirement
{
  public:
    explicit AtLeast (ArbiterSemanticVersion version) noexcept
      : _minimumVersion(version)
    {}

    bool satisfiedBy (const ArbiterSemanticVersion &version) const noexcept override
    {
      return version >= _minimumVersion;
    }

    bool operator== (const ArbiterRequirement &other) const noexcept override;

    std::unique_ptr<ArbiterRequirement> clone () const override
    {
      return std::make_unique<AtLeast>(*this);
    }

  private:
    ArbiterSemanticVersion _minimumVersion;
};

class CompatibleWith : public ArbiterRequirement
{
  public:
    explicit CompatibleWith (ArbiterSemanticVersion version, ArbiterRequirementStrictness strictness) noexcept
      : _baseVersion(version)
      , _strictness(strictness)
    {}

    bool satisfiedBy (const ArbiterSemanticVersion &version) const noexcept override;
    bool operator== (const ArbiterRequirement &other) const noexcept override;

    std::unique_ptr<ArbiterRequirement> clone () const override
    {
      return std::make_unique<CompatibleWith>(*this);
    }

  private:
    ArbiterSemanticVersion _baseVersion;
    ArbiterRequirementStrictness _strictness;
};

class Exactly : public ArbiterRequirement
{
  public:
    explicit Exactly (ArbiterSemanticVersion version) noexcept
      : _version(version)
    {}

    bool satisfiedBy (const ArbiterSemanticVersion &version) const noexcept override
    {
      return version == _version;
    }

    bool operator== (const ArbiterRequirement &other) const noexcept override;

    std::unique_ptr<ArbiterRequirement> clone () const override
    {
      return std::make_unique<Exactly>(*this);
    }

  private:
    ArbiterSemanticVersion _version;
};

}
}

#endif<commit_msg>Add missing moves for constructor arguments to Requirements<commit_after>#ifndef ARBITER_REQUIREMENT_INL_H
#define ARBITER_REQUIREMENT_INL_H

#ifndef __cplusplus
#error "This file must be compiled as C++."
#endif

#include "Requirement.h"
#include "Version-inl.h"

#include <memory>

struct ArbiterRequirement
{
  public:
    virtual ~ArbiterRequirement () = default;

    virtual bool satisfiedBy (const ArbiterSemanticVersion &version) const noexcept = 0;

    virtual bool operator== (const ArbiterRequirement &other) const noexcept = 0;

    virtual std::unique_ptr<ArbiterRequirement> clone () const = 0;

    bool operator!= (const ArbiterRequirement &other) const noexcept
    {
      return !(*this == other);
    }
};

namespace Arbiter {
namespace Requirement {

class Any : public ArbiterRequirement
{
  public:
    bool satisfiedBy (const ArbiterSemanticVersion &) const noexcept override
    {
      return true;
    }

    bool operator== (const ArbiterRequirement &other) const noexcept override
    {
      return (bool)dynamic_cast<const Any *>(&other);
    }

    std::unique_ptr<ArbiterRequirement> clone () const override
    {
      return std::make_unique<Any>(*this);
    }
};

class AtLeast : public ArbiterRequirement
{
  public:
    explicit AtLeast (ArbiterSemanticVersion version) noexcept
      : _minimumVersion(std::move(version))
    {}

    bool satisfiedBy (const ArbiterSemanticVersion &version) const noexcept override
    {
      return version >= _minimumVersion;
    }

    bool operator== (const ArbiterRequirement &other) const noexcept override;

    std::unique_ptr<ArbiterRequirement> clone () const override
    {
      return std::make_unique<AtLeast>(*this);
    }

  private:
    ArbiterSemanticVersion _minimumVersion;
};

class CompatibleWith : public ArbiterRequirement
{
  public:
    explicit CompatibleWith (ArbiterSemanticVersion version, ArbiterRequirementStrictness strictness) noexcept
      : _baseVersion(std::move(version))
      , _strictness(strictness)
    {}

    bool satisfiedBy (const ArbiterSemanticVersion &version) const noexcept override;
    bool operator== (const ArbiterRequirement &other) const noexcept override;

    std::unique_ptr<ArbiterRequirement> clone () const override
    {
      return std::make_unique<CompatibleWith>(*this);
    }

  private:
    ArbiterSemanticVersion _baseVersion;
    ArbiterRequirementStrictness _strictness;
};

class Exactly : public ArbiterRequirement
{
  public:
    explicit Exactly (ArbiterSemanticVersion version) noexcept
      : _version(std::move(version))
    {}

    bool satisfiedBy (const ArbiterSemanticVersion &version) const noexcept override
    {
      return version == _version;
    }

    bool operator== (const ArbiterRequirement &other) const noexcept override;

    std::unique_ptr<ArbiterRequirement> clone () const override
    {
      return std::make_unique<Exactly>(*this);
    }

  private:
    ArbiterSemanticVersion _version;
};

}
}

#endif
{'fraction_non_alphanumeric': 0.0865727380750297, 'fraction_numerical': 0.0010185028008827025, 'mean_word_length': 4.061855670103093, 'pattern_counts': {'":': 0, '<': 25, '<?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': '2933402', 'n_tokens_mistral': 1802, 'n_tokens_neox': 1758, 'n_words': 438}