<commit_before>#ifndef CGS_UNOWNED_PTR_HPP
#define CGS_UNOWNED_PTR_HPP

#include "cgs/assert.hpp"

namespace cgs
{

template <typename T>
class unowned_ptr
{
private:

    T* _p {};

public:

    constexpr unowned_ptr() noexcept = default;

    constexpr /* implicit */ unowned_ptr(T* p) noexcept
        : _p(p)
    { }

    constexpr unowned_ptr& operator=(T* p)
    {
        _p = p;
        return *this;
    }

    constexpr T& operator*() const
    {
        cgs_assert(_p);
        return *_p;
    }

    constexpr T* operator->() const
    {
        cgs_assert(_p);
        return _p;
    }

    constexpr T* or_null() const
    {
        return _p;
    }

    constexpr operator bool() const noexcept
    {
        return static_cast<bool>(_p);
    }

    constexpr bool operator!() const noexcept
    {
        return !_p;
    }

    constexpr bool operator==(const unowned_ptr& rhs) const noexcept
    {
        return _p == rhs._p;
    }

    constexpr bool operator!=(const unowned_ptr& rhs) const noexcept
    {
        return _p != rhs._p;
    }

    template <typename... Args>
    auto operator()(Args&&... args)
    {
        cgs_assert(_p);
        return _p(std::forward<Args>(args)...);
    }
};

} //namespace cgs

#endif // CGS_UNOWNED_PTR_HPP<commit_msg>add missing qualifiers in unowned_ptr<commit_after>#ifndef CGS_UNOWNED_PTR_HPP
#define CGS_UNOWNED_PTR_HPP

#include "cgs/assert.hpp"

namespace cgs
{

template <typename T>
class unowned_ptr
{
private:

    T* _p {};

public:

    constexpr unowned_ptr() noexcept = default;

    constexpr /* implicit */ unowned_ptr(T* p) noexcept
        : _p(p)
    { }

    constexpr unowned_ptr& operator=(T* p) noexcept
    {
        _p = p;
        return *this;
    }

    constexpr T& operator*() const
    {
        cgs_assert(_p);
        return *_p;
    }

    constexpr T* operator->() const
    {
        cgs_assert(_p);
        return _p;
    }

    constexpr T* or_null() const noexcept
    {
        return _p;
    }

    constexpr operator bool() const noexcept
    {
        return static_cast<bool>(_p);
    }

    constexpr bool operator!() const noexcept
    {
        return !_p;
    }

    constexpr bool operator==(const unowned_ptr& rhs) const noexcept
    {
        return _p == rhs._p;
    }

    constexpr bool operator!=(const unowned_ptr& rhs) const noexcept
    {
        return _p != rhs._p;
    }

    template <typename... Args>
    constexpr auto operator()(Args&&... args) const
    {
        cgs_assert(_p);
        return _p(std::forward<Args>(args)...);
    }
};

} //namespace cgs

#endif // CGS_UNOWNED_PTR_HPP
{'fraction_non_alphanumeric': 0.11629686304514154, 'fraction_numerical': 0.0, 'mean_word_length': 2.1392557022809124, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '5908987', 'n_tokens_mistral': 934, 'n_tokens_neox': 895, 'n_words': 211}