(C++) Opaque pointer

February 24, 2017 · View on GitHub

 

 

 

 

 

(C++) Opaque pointer

 

In general, 'Opaque' denotes the following [1]:

  1. Not allowing light to pass through; not transparent
  2. (of a statement,piece of writing,etc) not clear, difficult to understand

 

In C++, an opaque pointer is a pointer to a declared, but undefined class [2].

 

Opaque pointers are used in, among others, the pimpl idiom.

 

One of the advantages of using opaque pointers is an increase in compile speed.

 

 

 

 

 

References

 

  1. Oxford Advanced Learner's dictionary. ISBN:0-19-431422-7.
  2. Herb Sutter. Exceptional C++. ISBN: 0-201-61562-2. Item 27