<commit_before>/*
 * Copyright (c) 2019 Roc authors
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

//! @file roc_core/scoped_destructor.h
//! @brief Scoped destructor.

#ifndef ROC_CORE_SCOPED_DESTRUCTOR_H_
#define ROC_CORE_SCOPED_DESTRUCTOR_H_

#include "roc_core/noncopyable.h"

namespace roc {
namespace core {

//! Destroys the object via custom deleter.
template <class T, void (*Func)(T)> class ScopedDestructor : public NonCopyable<> {
public:
    //! Initialize.
    ScopedDestructor(T obj)
        : obj_(obj) {
    }<commit_msg>roc_core: mark constructor as explicit<commit_after>/*
 * Copyright (c) 2019 Roc authors
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

//! @file roc_core/scoped_destructor.h
//! @brief Scoped destructor.

#ifndef ROC_CORE_SCOPED_DESTRUCTOR_H_
#define ROC_CORE_SCOPED_DESTRUCTOR_H_

#include "roc_core/noncopyable.h"

namespace roc {
namespace core {

//! Destroys the object via custom deleter.
template <class T, void (*Func)(T)> class ScopedDestructor : public NonCopyable<> {
public:
    //! Initialize.
    explicit ScopedDestructor(T obj)
        : obj_(obj) {
    }
{'fraction_non_alphanumeric': 0.10654596100278552, 'fraction_numerical': 0.011142061281337047, 'mean_word_length': 3.696078431372549, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4810929', 'n_tokens_mistral': 511, 'n_tokens_neox': 474, 'n_words': 155}