<commit_before>#ifndef VTRC_CLOSURE_HOLDER_H
#define VTRC_CLOSURE_HOLDER_H

#include "google/protobuf/stubs/common.h"
#include "vtrc-memory.h"

namespace vtrc { namespace common {

    class closure_holder {

        google::protobuf::Closure *done_;

        closure_holder( const closure_holder &other );
        closure_holder& operator = ( const closure_holder &other );

    public:

        static
        vtrc::shared_ptr<closure_holder> create(google::protobuf::Closure *done)
        {
            return vtrc::make_shared<closure_holder>( done );
        }

        closure_holder( google::protobuf::Closure *done )
            :done_(done)
        { }

        google::protobuf::Closure *release( )
        {
            google::protobuf::Closure *old = done_;
            done_ =  NULL;
            return old;
        }

        ~closure_holder( ) try
        {
            if( done_ ) done_->Run( );
        } catch( ... ) { ;;; }

    };
}}

#endif // VTRCCLOSUREHOLDER_H
<commit_msg>common types<commit_after>#ifndef VTRC_CLOSURE_HOLDER_H
#define VTRC_CLOSURE_HOLDER_H

#include "google/protobuf/stubs/common.h"
#include "vtrc-memory.h"

namespace vtrc { namespace common {

    class closure_holder {

        google::protobuf::Closure *done_;

        closure_holder( const closure_holder &other );
        closure_holder& operator = ( const closure_holder &other );

    public:

        static
        vtrc::shared_ptr<closure_holder> create(google::protobuf::Closure *done)
        {
            return vtrc::make_shared<closure_holder>( done );
        }

        closure_holder( google::protobuf::Closure *done )
            :done_(done)
        { }

        google::protobuf::Closure *release( )
        {
            google::protobuf::Closure *old = done_;
            done_ =  NULL;
            return old;
        }

        ~closure_holder( )
        { try {
            if( done_ ) done_->Run( );
        } catch( ... ) {
            ;;;
        }}

    };
}}

#endif // VTRCCLOSUREHOLDER_H

{'fraction_non_alphanumeric': 0.11683168316831684, 'fraction_numerical': 0.0, 'mean_word_length': 2.1044546850998462, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3004648', 'n_tokens_mistral': 647, 'n_tokens_neox': 618, 'n_words': 109}