Announcement

Collapse
No announcement yet.

Features You Should Be Able To Find In C++14

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Skrapion
    replied
    The standard library also comes with codecvt classes for using UTF, although I just use my own UTF string class. Unicode is a huge standard when you include normalization, collation, character properties, etc, but the UTF part is pretty straight forward.

    Although I certainly wish u8 strings and narrow strings had a different type.

    Leave a comment:


  • danwood76
    replied
    Originally posted by erendorn View Post
    Mostly, there's no compartmentalization between different includes.
    Like, including windows.h will break your template definition using std::min, and things like that.
    The include directive includes the actual code, while what you want most of the time is importing the definitions, sandboxed from one another.
    See these slides for more thoughts on the subject:
    http://llvm.org/devmtg/2012-11/Gregor-Modules.pdf
    There's your problem right there!

    #include <windows.h> usually breaks any piece of software!

    Leave a comment:


  • erendorn
    replied
    Originally posted by wizard69 View Post
    What is wrong with header files? The need to guard against multiple inclusions is a pain but honestly the compilers should be required to deal with that problem not the programmer.
    Mostly, there's no compartmentalization between different includes.
    Like, including windows.h will break your template definition using std::min, and things like that.
    The include directive includes the actual code, while what you want most of the time is importing the definitions, sandboxed from one another.
    See these slides for more thoughts on the subject:
    http://llvm.org/devmtg/2012-11/Gregor-Modules.pdf

    Leave a comment:


  • carewolf
    replied
    Originally posted by wizard69 View Post
    Does anybody have a usable solution? Unicode was one of those designed by committee things that will always be a struggle to implement and more importantly put into use.
    Use QString?

    Or u16string. Though you may need to bind with ICU yourself to get a copy of all the insanity required to deal with unicode according to standard.

    Leave a comment:


  • wizard69
    replied
    Originally posted by mirza View Post
    First thing they shoud do, is get rid of header and lib files (soooo '70 hippie style),
    What is wrong with header files? The need to guard against multiple inclusions is a pain but honestly the compilers should be required to deal with that problem not the programmer.
    ane move to something sane, like AT LEAST package / .JAR files in java.
    When you have a sane example please post it.
    Actually no, it is already too late. Vast majority of developers followed Android and Java away from C.
    Which is total crap "fact" as can be seen in the repositories for Android. Android is in fact loosing market share and more importantly the desire from the big manufactures to implement Android solutions.
    C/C++ is now language for kernel, and system things sitting next to kernel. And for enthusiasts. World moved on in the meantime.
    Obviously you are out of touch. C++, with that advent of the 2011 standard is now a force to be reckoned with for developers. I can actually see a significant shift towards C++ where it matters. More it works extremely well in mixed environments where the likes of Python, Lua and other scripting languages handle the light work. Given that, C++11 should significantly speed up development making the mixed environments even less important. Effectively C++ has been reborn with this latest overhaul.

    Leave a comment:


  • wizard69
    replied
    Originally posted by mark45 View Post
    Still no usable solution on unicode strings.
    Does anybody have a usable solution? Unicode was one of those designed by committee things that will always be a struggle to implement and more importantly put into use.

    Leave a comment:


  • Ericg
    replied
    Originally posted by zoomblab View Post
    Modules are not going to make header files to go away. Unlike Java the C compiler can not read the declarations from the binary (that would require a portable binary standard) or the implementation files.
    Oh I know, but THAT is a whole separate issue all together than simply "bringing modules to C++"

    Leave a comment:


  • zoomblab
    replied
    Originally posted by Ericg View Post
    Read the blogpost before you comment. Modules were tried to get ready for C++14 but they didn't make the deadline. They've been pushed back to C++17, which the developers think is more than enough time.
    Modules are not going to make header files to go away. Unlike Java the C compiler can not read the declarations from the binary (that would require a portable binary standard) or the implementation files.

    Leave a comment:


  • carewolf
    replied
    Originally posted by mark45 View Post
    He is complaining about Windows, and apparently doesn't know u16string and u32string (aka basic_string<char16_t> and basic_string<char32_t>).

    Leave a comment:


  • mark45
    replied
    Originally posted by zanny View Post
    Code:
    #include <iostream>
    #include <string>
    
    int main() {
      std::string str { u8"Unicode characters: ◧ ◬ ☎ ♾ ⚠ ☔\n" };
      std::cout << str << std::endl;
    }
    Compile with -std=c++11 or -std=c++14.

    What is the problem?
    Your example has nothing to do with what I said.

    http://stackoverflow.com/questions/17103925/how-well-is-unicode-supported-in-c11
    http://cppwhispers.blogspot.com/2012/11/unicode-and-your-application-3-of-n.html

    Leave a comment:

Working...
X