• 0 Posts
  • 15 Comments
Joined 2 years ago
cake
Cake day: July 31st, 2023

help-circle


  • std::string doesn’t have a template type for the allocator. You are stuck using the verbose basic_string type if you need a special allocator.

    But, of course, nobody sane would write that by hand every time. They would use a typedef, like how std::string is just a typedef for std::basic_string<char, std::char_traits<char>, std::allocator<char>>. Regardless, the C++ standard library is insanely verbose when you start dropping down into template types and using features at an intermediate level. SFINAE in older versions of C++ was mindfuck on the best of days, for example.

    Don’t get me wrong, though. I’m not saying Rust is much better. Its saving grace is its type inference in let expressions. Without it, chaining functional operations on iterators would be an unfathomable hellscape of Collect<Skip<Map<vec::Iter<Item = &'a str>>>>




  • Rust is verbose, but C++ might still take the cake with its standard library templates. Especially when using fully-qualified type names…

    auto a = ::std::make_shared<::std::basic_string<char, ::std::char_traits<char>, MyAllocator<char>>>();

    A reference-counted shared pointer to a string of unspecified character encoding and using a non-default memory allocator.





  • Ok, now suppose you want to release a game for any of the modern Nintendo consoles.

    You need to get a devkit. To get it, you need Nintendo to approve your request, and you need to pay them for a license to use the devkit hardware. And, to actually use the devkit, you need a PC running Windows.

    Sure, to develop a game for PC, you need a PC. But do you know what you don’t need on top of that? A devkit and a Windows license.

    Edit: Two downvotes in two minutes? Oh my, the sockpuppets are angry today.





  • You shall not use or attempt to use a device or software (such as NAT, Address Masquerading, Proxying, or the connection of an additional wireless router) that would allow you to connect more than the number of devices set out in the Service Information to the Network.

    One of the ways they detect this is by checking the TTL of the packets coming from the “one” device is less than expected. If your router is using OpenWrt, you can configure an iptables rule to reset the TTL of outgoing packets to the default.