diff --git a/sklearn/tree/_tree.pyx b/sklearn/tree/_tree.pyx index 712e352b000ab..374cd2e29df79 100644 --- a/sklearn/tree/_tree.pyx +++ b/sklearn/tree/_tree.pyx @@ -22,6 +22,7 @@ from libc.math cimport isnan from libcpp.vector cimport vector from libcpp.algorithm cimport pop_heap from libcpp.algorithm cimport push_heap +from libcpp.stack cimport stack from libcpp cimport bool import struct @@ -43,15 +44,6 @@ cdef extern from "numpy/arrayobject.h": void* data, int flags, object obj) int PyArray_SetBaseObject(cnp.ndarray arr, PyObject* obj) -cdef extern from "" namespace "std" nogil: - cdef cppclass stack[T]: - ctypedef T value_type - stack() except + - bint empty() - void pop() - void push(T&) except + # Raise c++ exception for bad_alloc -> MemoryError - T& top() - # ============================================================================= # Types and constants # =============================================================================