Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Bug with 'using' and 'typedef' in a namespace

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
pjwhams Posted - Jan 19 2015 : 10:24:04 AM
VS2013 update 3
VAX: 10.9.2052

I've experienced a bug with 'using' for doing a C++11-style typedef inside a namespace. If you declare the following:


#include <vector>

class MyNamespace {
  typedef std::vector<int> IntVector;
  using FloatVector = typedef std::vector<float>;
}

class MyNamespace {

  void f(IntVector v1, FloatVector v2) {
  }

  int main(int argc, char* argv[])
  {
	IntVector v1;
	FloatVector v2;
   }
}


Then you see that FloatVector isn't recognised (it isn't highlighted, alt-g doesn't work, intellisense doesn't work). However if you remove all the namespaces then it works ok.

Related to http://forums.wholetomato.com/forum/topic.asp?TOPIC_ID=11729&SearchTerms=typedef,using
5   L A T E S T    R E P L I E S    (Newest First)
pjwhams Posted - Nov 24 2015 : 03:46:31 AM
That's great, thanks!
sean Posted - Nov 20 2015 : 4:08:07 PM
case=87178 is fixed in build 2083
pjwhams Posted - Jan 29 2015 : 09:14:19 AM
Ah yes, my mistake, sorry. Removing the incorrect 'typedef' still reproduces the bug though.
jschroedl Posted - Jan 29 2015 : 08:58:37 AM
Shouldn't this:

using FloatVector = typedef std::vector<float>;

be:

using FloatVector = std::vector<float>;

??

I don't believe the 'typedef' should be in there but maybe this is a usage which is allowed for some reason?
accord Posted - Jan 20 2015 : 3:37:04 PM
I am seeing the same effect here. Thank you for the sample code.

case=87178

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000