Tous les livres

Professionnel

Applis À propos Coach Connexion Commencer la lecture

Computer Science · Glossaire

Qu'est-ce que « Resource, RAII » ?

Aussi appelé : resource · resource acquisition is initialisation (RAII)

Definition 1.11 University Computer Science — Year 2 · Chapitre 1 — From C to C++: Classes and Resource Management

A resource is anything a program acquires and must give back: a block of heap memory, an open file, a lock, a network connection. Resource acquisition is initialisation (RAII) is the rule that every resource is acquired by the constructor of an object that owns it, and released by that object’s destructor.

Lire dans le chapitre →