Mad Fish
Mad Fish

Reputation: 713

Is there a C++ IDE which handles templates well?

Every IDE I've tried fails to provide code-completion when something template-related is used. For example,

boost::shared_ptr<Object> ptr;
ptr->[cursor is here]

Is there IDE that can provide code completion in this case?

Upvotes: 13

Views: 2120

Answers (9)

Tod
Tod

Reputation: 8242

This works in Eclipse CDT, but you may have to explcitly set the include paths under Project->Properties->C/C++ General->Paths and Symbols. Under my env. I had to dig down and explicitly add the include\c++\4.2.1 and include\c++\4.2.1\m68k-elf. Just having the directory specified to the cross compiler root \include did not allow content assist to work. Of course once you add the directories, rebuild the index.

You might need to check your Windows->Preferenes->C/C++->Indexer Cache Limit settings and increase them if they are too small. I have mine set to a max of 256MB.

Upvotes: 1

quant_dev
quant_dev

Reputation: 6231

Netbeans sometimes gets it right, but not always. It's non-deterministic: seemingly similar code may get parsed, or not, depending on the whim of the IDE.

Upvotes: 0

Rob Wells
Rob Wells

Reputation: 37113

G'day,

As an aside, I'd highly recommend Scott Meyers's excellent "Effective STL" book.

Item 49 "Learn to decipher STL-related compiler diagnostics" is worth the price of admission alone! The info therein is also applicable to decoding complex template related diagnostics beyond STL, e.g. for Boost.

Have fun.

BTW +1 for an interesting question.

cheers,

Upvotes: 2

Terry Mahaffey
Terry Mahaffey

Reputation: 11981

Visual Studio 2010 has significantly improved in this area. There is an open beta going on, you should check it out.

Upvotes: 1

Michel Gokan Khan
Michel Gokan Khan

Reputation: 2625

I've always use Eclipse C/C++ IDE. It supports code completion as well :)

Upvotes: 3

Glen
Glen

Reputation: 22290

Eclipse + the CDT plugin will handle this as well as the other tools mentioned

Upvotes: 1

ROAR
ROAR

Reputation: 1324

I believe Slickedit (http://www.slickedit.com) handles this pretty well.

Upvotes: 0

Idan K
Idan K

Reputation: 20881

Actually this is a fairly simple template use-case, Qt Creator can handle this easily and more complex template code aswell.

Upvotes: 6

Macke
Macke

Reputation: 25690

Visual Studio with Visual Assist X handles that case, but still fails more complex code.

Upvotes: 7

Related Questions