#pragma once

template <class T, class S>
THolder<T> DynamicHolderCast(THolder<S> holder) {
    THolder<T> result{dynamic_cast<T *>(holder.Get())};
    if (result) {
        [[maybe_unused]] auto _ =  holder.Release();
    }
    return result;
}
