Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Bug with 'using' and 'typedef' in a namespace
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

pjwhams
Junior Member

24 Posts

Posted - Jan 19 2015 :  10:24:04 AM  Show Profile  Reply with Quote
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

accord
Whole Tomato Software

United Kingdom
3163 Posts

Posted - Jan 20 2015 :  3:37:04 PM  Show Profile  Reply with Quote
I am seeing the same effect here. Thank you for the sample code.

case=87178
Go to Top of Page

jschroedl
Ketchup Master

USA
91 Posts

Posted - Jan 29 2015 :  08:58:37 AM  Show Profile  Reply with Quote
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?
Go to Top of Page

pjwhams
Junior Member

24 Posts

Posted - Jan 29 2015 :  09:14:19 AM  Show Profile  Reply with Quote
Ah yes, my mistake, sorry. Removing the incorrect 'typedef' still reproduces the bug though.
Go to Top of Page

sean
Whole Tomato Software

USA
2640 Posts

Posted - Nov 20 2015 :  4:08:07 PM  Show Profile  Reply with Quote
case=87178 is fixed in build 2083
Go to Top of Page

pjwhams
Junior Member

24 Posts

Posted - Nov 24 2015 :  03:46:31 AM  Show Profile  Reply with Quote
That's great, thanks!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2019 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000