CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Threaded View

  1. #5
    Join Date
    Jan 2009
    Location
    Salt Lake City, Utah
    Posts
    82

    Re: Problems Using New Types

    Quote Originally Posted by Speedo View Post
    It is const, in exactly the manner you asked for it to be. You're trying to assume that typedefs are simply text substitutions - they aren't. And needless to say, trying to argue that something is stupid just because it doesn't work like you want it to work is, well, a bit stupid.
    I want something const, so I put const in front of it. Why else would it be there? I don't care if it overwrites the constness of the type used. When someone explicitly says something, it should explicitly happen. So, yes, how it is setup is stupid. It has nothing to do with thinking it's a text substitution. It has everything to do with explicit, predictable semantic behavior

    btw, solved this by making separate types for const (i.e. for cstring it was : typedef const char * const c_cstring_c; ) A bit sloppy in my oppinion, but it works
    Last edited by Etherous; April 25th, 2009 at 09:45 PM.
    Intel Core Duo Macbook w/ Mac OS 10.5.6
    gcc 4.2.1 (i386-apple-darwin9.1.0) and Xcode 3.1.1

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured