Thread: How do I create a filename with multiple variable types

  1. #31
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    Except when it is, like Elysia's "I put an assertion here as a placeholder until further notice" kind of thing
    Hoisted by my own petard. ;_;

    Anyway, is anyone interested in seeing this functionality, whether as input manipulator or as operator>> overloads, added to the C++ standard?
    I think it fails as a stream manipulator. Certainly a "skip this many characters" could be a manipulator ("std::cin >> skip(15)"), and "always skip this character" could be a manipulator ("std::cin >> ignore('$')"), but extracting a literal from a stream screams overloaded stream operation to me.

    [Edit]
    And yea, it could be a standard feature, but until they provide more internationalization primitives (such as the Unicode algorithm for collation) I'm not sure how useful it would be. I could put a literal literal ("std::cin >> literal("This is English.")") and require an exact binary match, but a locale literal would be spectacular ("std::cin >> literal("naïveté")") for dealing with those combining characters and things.
    [/Edit]

    Soma
    Last edited by phantomotap; 02-12-2012 at 10:01 AM.

  2. #32
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by laserlight View Post
    Anyway, is anyone interested in seeing this functionality, whether as input manipulator or as operator>> overloads, added to the C++ standard?
    Sure. I think this will simplify parsing a little. There would be no need for extract, check if is as expected any longer. Just extract and ignore (but fail if not what was expected).
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Overloading a variable with multiple data types
    By CPlus in forum C++ Programming
    Replies: 18
    Last Post: 02-13-2010, 04:25 PM
  2. Creating multiple files with string as filename
    By jmayer in forum C++ Programming
    Replies: 2
    Last Post: 01-25-2008, 09:55 AM
  3. Using a variable for a filename
    By Unlockitall in forum C++ Programming
    Replies: 4
    Last Post: 12-15-2007, 10:41 AM
  4. I/O--Using a variable as a filename
    By jedo in forum C++ Programming
    Replies: 7
    Last Post: 09-06-2005, 10:57 AM
  5. Variable filename
    By Azmeos in forum C++ Programming
    Replies: 7
    Last Post: 06-09-2003, 02:42 PM

Tags for this Thread