help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs function for writing C++ iterator loop


From: weber
Subject: Re: emacs function for writing C++ iterator loop
Date: Fri, 29 Jun 2007 03:22:57 -0000
User-agent: G2/1.0

On 28 jun, 21:56, Mohitz <coolmoh...@gmail.com> wrote:
> I program in C++ using emacs. And i tend to use the C++ iterator a
> lot. Now, whenever I want to iterate I always write almost the same
> kinda code. So, i want to write a emacs function so that emacs does
> that for me.
>
> For example
>
> If i tell emacs that i am iterating on a "deque<ClassName> " variable
> with variable name "var" pointing to
> "someThing", Emacs should potentially be able to generate the
> following
>
> deque<CLassName> var = someThing;
> deque<ClassName>::iterator varIterate;
> varIterate = var.begin();
> while (varIterate != var.end())
> {
>       ClassName tempClassName;
>       tempClassName = *varIterate;
>
>       //Do something with tempClassName
>
>       varIterate++;
>
> }
>
> Any kind of help or pointers to help material would be greatly
> appreciated
>
> Thanks
> Mohit

Hi
This is probably a good starting point:
http://www.emacswiki.org/cgi-bin/wiki/SkeletonMode
Cheers,
weber



reply via email to

[Prev in Thread] Current Thread [Next in Thread]