RAII-class instance in C++

You want to use the resource via an instance of a RAII-class. In which of the given scenarios can this be achieved?

1. The RAII-class has automatic storage duration.

2. The RAII-class has lifetime that is bounded by the lifetime of an automatic object.

Options
  1. Only 1
  2. Only 2
  3. Both 1 and 2
  4. Neither 1 nor 2

Related Posts