What is wrong with VC++?

This is a discussion on What is wrong with VC++? within the C++ Programming forums, part of the General Programming Boards category; Sometimes its behavior baffles me. I have a scaled down implemented string class which has a constructor which takes a ...

  1. #1
    Registered User Sharke's Avatar
    Join Date
    Jun 2008
    Location
    NYC
    Posts
    303

    What is wrong with VC++?

    Sometimes its behavior baffles me. I have a scaled down implemented string class which has a constructor which takes a const char*. The + operator is overloaded for concatenation and so I can add a string literal to an object of the class via a constructor conversion.

    So out of curiosity I decided to make that constructor explicit to check that I could no longer convert from a const char*. To my surprise, it didn't complain on compilation and carried out the conversion. I compiled it again and again and the same result. I even whimsically made all of the other constructors explicit out of desperation, still no error.

    It was only after rebooting and firing up VC++ again that the explicit specifier was taken notice of. Is there something obvious that I'm missing here, or is VC++ just a couple of sandwiches short of a picnic?

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,655
    >> or is VC++ just a couple of sandwiches short of a picnic?

    I wouldn't rule it out, personally.

  3. #3
    Registered User Sharke's Avatar
    Join Date
    Jun 2008
    Location
    NYC
    Posts
    303
    Quote Originally Posted by Sebastiani View Post
    >> or is VC++ just a couple of sandwiches short of a picnic?

    I wouldn't rule it out, personally.
    Come to think of it, given how frequently Intellisense just won't fire up until I cross my eyes and stick my tongue out at a certain angle, neither would I.

  4. #4
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,235
    Quote Originally Posted by Sharke View Post
    It was only after rebooting and firing up VC++ again that the explicit specifier was taken notice of. Is there something obvious that I'm missing here, or is VC++ just a couple of sandwiches short of a picnic?
    Sounds like the issue is not the compiler but something wrong in the build environment. The most likely theory is that the system clock was out of whack, and VC++ did not notice the change, and failed to recompile one or more source modules.

    You probably could have gotten away with a Clean following by a recompile. If file timestamps get out of sync, the build process will go wrong, and that isn't Visual Studio's fault. (Not that I'm defending it.)
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  5. #5
    Registered User Sharke's Avatar
    Join Date
    Jun 2008
    Location
    NYC
    Posts
    303
    Aha, I was not aware of the clean build command.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 07-15-2004, 03:30 PM
  2. Debugging-Looking in the wrong places
    By JaWiB in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 11-03-2003, 09:50 PM
  3. Confused: What is wrong with void??
    By Machewy in forum C++ Programming
    Replies: 19
    Last Post: 04-15-2003, 12:40 PM
  4. God
    By datainjector in forum A Brief History of Cprogramming.com
    Replies: 746
    Last Post: 12-22-2002, 11:01 AM
  5. Whats wrong?
    By Unregistered in forum C Programming
    Replies: 6
    Last Post: 07-14-2002, 01:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21