On 22. Dec 2006, at 03:06, Ryan Wilcox wrote:
I'd like to propose two additions to the C bundle.
First, an easy snippet: typedef. [...]
Second, a modification on an old favorite: the class snippet.
Most of the classes I write are subclasses of something else. Except the class snippet echos my colon and subclass declaration. Meaning, I end up with class declarations like: [...]
I just did this checkin:
• add typedef snippet (with tab trigger ‘td’) • change tab trigger for class and struct to ‘cl’ and ‘st’ respectively (semi-consistent with ‘ns’ and ‘td’) • make the class snippet strip potential “ : public base_class” from first placeholder when mirroring it down in the constructor/ destructor name
Since most of the classes I write are not derived classes, I went for the “strip the public bit in the constructor” rather than make a placeholder for the base class (which I would then always have to delete).