Is this guaranteed to be correct? - Page 4
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 4 of 4 FirstFirst 1234
Results 46 to 49 of 49

Thread: Is this guaranteed to be correct?

  1. #46
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,100

    Re: Is this guaranteed to be correct?

    Quote Originally Posted by razzle View Post
    Second, there is no C++ legislation so there is no notion of legitimate/illegitimate usage of C++. In short, you do what you like and it's legitimate if you say so.
    not quite.
    there is such a thing as the general consensue where the vast majority will agree that some things are safe and other are better avoided. If you do use any of the "better avoided" things, then you have only yourself to blame for shooting y ourself in the foot.
    but sometimes there are real world practical reasons to indeed shoot yourself in both feet, and stab yourself in the kidney with a rusty blade. it's not fun, but it is necessary at times.


    Please feel free to give away the C++ type safety for Boost::Any convenience.
    boost::any is perfectly type safe because it is a type all of it's own exactly as you instantiate it.
    what you do with boost any is not necessarily safe, but the same can be said about a lot of things.


    Fortunately for you the C++ standards committee is more concerned with your health than I am. It has keep Boost.Any out for decades so at least it's not part of C++. And it probably never will. In the directives to the C++ 11 standard:
    And I have pointed out before that while it's not in the standard (yet) because the committee had issues with the proposed implementation. They are NOT averse of the concept of a generic component type.

    Afterall, tupple<> which IS in the standard is arguably essentially a special case of the any<> where all types are Always valid, but with similar "unsafe" usage scenarios. If you are so inclined, you could even construct an "any" out of a tuple of smart pointer types, and essentially get the exact type of behaviour the any class would need to have.

    My question remains. Why are so many programmers so hellbent on making C++ less type safe? Why is so much time and effort spent on making C++ more brittle and error-prone? That's what "other readers" should ask themselves.
    because there are real world problems that are easy to solve with a any/variant type, and that take a lot more effort with alternative solutions.
    Do it wrong and you shoot yourself in the foot
    do it right, and you wear armored boots first, shoot yourself in the foot and find that nothing harmful has happened.

    I see worse offenses on a daily basis to not be concerned about this at all.

  2. #47
    Join Date
    Jul 2013
    Posts
    376

    Re: Is this guaranteed to be correct?

    Quote Originally Posted by OReubens View Post
    not quite.
    You've replied to my answer to superbonzo (#43) and not to my answer to you (#41).

    It's better if you defend the stupidities you write yourself and not the stupidities superbonzo write, but since I'm an equal opportunity stupidity opposer I'll respond to your post anyway.
    Last edited by razzle; September 12th, 2014 at 04:52 PM.

  3. #48
    Join Date
    Oct 2008
    Posts
    1,168

    Re: Is this guaranteed to be correct?

    Quote Originally Posted by razzle View Post
    You've replied to my answer to superbonzo (#43) and not to my answer to you (#41).

    It's better if you defend the stupidities you write yourself and not the stupidities superbonzo write, but since I'm an equal opportunity stupidity opposer I'll respond to your post anyway.
    sadly nothing much to say ... just avoid off-topic non-technical offensive comments, please.

  4. #49
    Join Date
    Oct 2008
    Posts
    1,168

    Re: Is this guaranteed to be correct?

    Quote Originally Posted by razzle View Post
    Sorry, but as you may have noticed I'm very competitive and when I've defeated someone in a discussion I usually perform a small war dance ritual to celebrate the occasion.

    So before you engage in a discussion with me again make sure to know what you're talking about, otherwise you'll soon find me dancing around you again.

    Ever since our "waterfront" discussion I know you don't know what you're talking about. You may have qualities in detail matters but when it comes to broader issues you're lost. I don't believe you have the prominent position you're letting on.
    wow, maybe a moderator warning could bring the dicussion to a more civil level, at least to avoid totally offtopic and psychiatric posts like the above. I doubt so though, having you already been banned many times ... maybe, it's time to try the forum "ignore list" feature ( really hope it works ! EDIT: wow, it works ! EDIT2: oh no, of course you need to be loggedin in order for it to work ... doh !)
    Last edited by superbonzo; September 20th, 2014 at 03:29 AM.

Page 4 of 4 FirstFirst 1234

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center