Why can’t Java/C# implement RAII?
Question:
Why can’t Java/C# implement RAII?
C API in C++ with RAII, two alternatives to implement error handling (Exceptions)
I have an API written in C, which produces a result by returning a pointer to allocated memory.
For using it with C++ (C++11) I’ve wrapped the function calls in objects, which keep the result in a std::shared_ptr
. So far so good.
Disadvantages of scoped-based memory management
I really like scope-based memory management (SBMM), or RAII, as it is more commonly (confusingly?) referred to by the C++ community. As far as I know, except for C++ (and C), there’s no other mainstream language in use today that makes SBMM/RAII their main memory management mechanism, and instead they prefer to use garbage collection (GC).
Disadvantages of scoped-based memory management
I really like scope-based memory management (SBMM), or RAII, as it is more commonly (confusingly?) referred to by the C++ community. As far as I know, except for C++ (and C), there’s no other mainstream language in use today that makes SBMM/RAII their main memory management mechanism, and instead they prefer to use garbage collection (GC).
Disadvantages of scoped-based memory management
I really like scope-based memory management (SBMM), or RAII, as it is more commonly (confusingly?) referred to by the C++ community. As far as I know, except for C++ (and C), there’s no other mainstream language in use today that makes SBMM/RAII their main memory management mechanism, and instead they prefer to use garbage collection (GC).
Disadvantages of scoped-based memory management
I really like scope-based memory management (SBMM), or RAII, as it is more commonly (confusingly?) referred to by the C++ community. As far as I know, except for C++ (and C), there’s no other mainstream language in use today that makes SBMM/RAII their main memory management mechanism, and instead they prefer to use garbage collection (GC).
Disadvantages of scoped-based memory management
I really like scope-based memory management (SBMM), or RAII, as it is more commonly (confusingly?) referred to by the C++ community. As far as I know, except for C++ (and C), there’s no other mainstream language in use today that makes SBMM/RAII their main memory management mechanism, and instead they prefer to use garbage collection (GC).
Is there a way to use RAII techniques in COM?
I am caught between two conceptual models of how to construct objects, and am having trouble working out what standard I want to adopt.
Is there a way to use RAII techniques in COM?
I am caught between two conceptual models of how to construct objects, and am having trouble working out what standard I want to adopt.