Item 27. (Im)pure Virtual Functions

I l @ ve RuBoard

Difficulty: 7

Does it ever make sense to make a function pure virtual, but still provide a body?

  1. What is a pure virtual function? Give an example.

  2. Why might you declare a pure virtual function and also write a definition (body)? Give as many possible reasons or situations as you can.

I l @ ve RuBoard


More Exceptional C++
More Exceptional C++: 40 New Engineering Puzzles, Programming Problems, and Solutions
ISBN: 020170434X
EAN: 2147483647
Year: 2001
Pages: 118
Authors: Herb Sutter

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net