<commit_before>/* ----------------------------------------------------------------------- *//**
 *
 * @file Reference.hpp
 *
 *//* ----------------------------------------------------------------------- */

#ifndef MADLIB_REFERENCE_HPP
#define MADLIB_REFERENCE_HPP

namespace madlib {

namespace utils {

template <typename T, typename U = T>
class Reference {
public:
    Reference(T *inPtr) {
        mPtr = inPtr;
    }
    
    Reference &rebind(T *inPtr) {
        mPtr = inPtr;
        return *this;
    }

    operator U() const {
        return static_cast<U>(*mPtr);
    }
    
    Reference &operator=(const U &inValue) {
        *mPtr = inValue;
        return *this;
    }
    
    Reference &operator+=(const U &inValue) {
        *mPtr += inValue;
        return *this;
    }

    Reference &operator-=(const U &inValue) {
        *mPtr -= inValue;
        return *this;
    }
    
    U operator++(int) {
        U returnValue = static_cast<U>(*mPtr);
        *mPtr++;
        return returnValue;
    }
    
    Reference &operator++() {
        *mPtr++;
        return *this;
    }
        
protected:
    T *mPtr;
};


} // namespace modules

} // namespace regress

#endif<commit_msg>Bug in Reference.hpp. As an exercise write 1e6 times: Postfix increment binds stronger than de-referencing operator.<commit_after>/* ----------------------------------------------------------------------- *//**
 *
 * @file Reference.hpp
 *
 *//* ----------------------------------------------------------------------- */

#ifndef MADLIB_REFERENCE_HPP
#define MADLIB_REFERENCE_HPP

namespace madlib {

namespace utils {

template <typename T, typename U = T>
class Reference {
public:
    Reference(T *inPtr) {
        mPtr = inPtr;
    }
    
    Reference &rebind(T *inPtr) {
        mPtr = inPtr;
        return *this;
    }

    operator U() const {
        return static_cast<U>(*mPtr);
    }
    
    Reference &operator=(const U &inValue) {
        *mPtr = inValue;
        return *this;
    }
    
    Reference &operator+=(const U &inValue) {
        *mPtr += inValue;
        return *this;
    }

    Reference &operator-=(const U &inValue) {
        *mPtr -= inValue;
        return *this;
    }
    
    U operator++(int) {
        U returnValue = static_cast<U>(*mPtr);
        *mPtr += 1;
        return returnValue;
    }
    
    Reference &operator++() {
        *mPtr += 1;
        return *this;
    }
        
protected:
    T *mPtr;
};


} // namespace modules

} // namespace regress

#endif
{'fraction_non_alphanumeric': 0.22721846398726622, 'fraction_numerical': 0.0015917230401910067, 'mean_word_length': 1.4080459770114941, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '6159001', 'n_tokens_mistral': 763, 'n_tokens_neox': 747, 'n_words': 178}