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

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

emacs function for writing C++ iterator loop


From: Mohitz
Subject: emacs function for writing C++ iterator loop
Date: Fri, 29 Jun 2007 00:56:46 -0000
User-agent: G2/1.0

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



reply via email to

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