raii
boost::shared_?? for non-pointer resources
Basically i need to do reference counting on certain resources (like an integer index) that are not inmediately equivalent to a pointer/address semantic; basically i need to pass开发者_开发百科 around[详细]
2023-02-12 00:10 分类:问答Does PHP support the RAII pattern? How?
Most resources on PHP never touch memory management because the language itself is pretty good at doing this for you. However, in PHP you often end up dealing with external resources which aren\'t mem[详细]
2023-02-09 03:07 分类:问答why is overloading needed when using operator<< via template?
As in this question, I\'m experimenting to stream via a class using SBRM/RAII, so SBRM(x) << \"test\";[详细]
2023-01-24 04:12 分类:问答When a RAII object fails to construct
Suppose I construct a RAII object, and that object may fail to construct. How do I handle this? try { std::v开发者_JAVA技巧ector<int> v(LOTS);[详细]
2023-01-22 14:26 分类:问答Stack-based object instantiation in D
I\'m learning D, and am confused by an error I\'m getting. Consider the following: module helloworld; import std.stdio;[详细]
2023-01-21 11:47 分类:问答Is there any research on (or better use of) of RAII in GC languages?
Note: Object Lifetime RAII not using/with block scope RAII It seems like its possible using an extra gc category, short lived objects(check gc category somewhat frequently), long lived objects(check[详细]
2023-01-15 09:35 分类:问答Using RAII with C++ streams and STL containers?
I\'m trying to use RAII concepts with an STL container of ofstream objects.For example: int main(int argc, char**argv)[详细]
2023-01-09 04:50 分类:问答Exception within function returning value for constructor
Let\'s say I have class that acts as a \"smart pointer\" and releases some kind of system resource when destroyed.[详细]
2023-01-08 23:50 分类:问答When not to use RAII for resource management [closed]
开发者_JS百科 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely soli[详细]
2023-01-08 18:11 分类:问答Can you use a shared_ptr for RAII of C-style arrays?
I\'m working on a section of code that has many possible failure points which cause it to exit the function early.The libraries I\'m interacting with r开发者_StackOverflowequire that C-style arrays be[详细]
2023-01-08 03:42 分类:问答