Prev: return(ing) a smart pointer
Next: Call For Manuscripts: International Journal of Signal Processing (IJSP)
From: Pavel Romanovski on 27 Feb 2010 10:40 What does the = 0 mean at the end of these function definitions? template <class Etype> void Write(const Etype & X) = 0; const Etype & Read() const = 0;
From: Alf P. Steinbach on 27 Feb 2010 11:51 * Pavel Romanovski: > What does the = 0 mean at the end of these function definitions? > > template <class Etype> > void Write(const Etype & X) = 0; > const Etype & Read() const = 0; This is not real code. One can always *guess* about what the real code must have been, and in this case that's not too difficult. But then, if e.g. I did that and it turned out to be a lucky guess, then next time you're asking about something you'd do the same, posting incomplete and misleading information about the problem, so please, post the real code. Cheers & hth., - Alf PS: Any good textbook discusses the basic syntax of C++.
From: osmium on 27 Feb 2010 14:19
"Pavel Romanovski" wrote: > What does the = 0 mean at the end of these function definitions? > > template <class Etype> > void Write(const Etype & X) = 0; > const Etype & Read() const = 0; The "= 0" syntax is used to identify a *pure* virtual function. Look around on the link. http://en.wikipedia.org/wiki/Virtual_function#Abstract_classes_and_pure_virtual_functions |