Bobinas P4G
  • Login
  • Public

    • Public
    • Groups
    • Popular
    • People

Conversation

Notices

  1. Bernie (codewiz@mstdn.io)'s status on Saturday, 28-May-2022 17:49:23 UTC Bernie Bernie

    Here's another way in which C++ sucks:
    https://godbolt.org/z/1v6qsW8vP

    After 30 years of professional C++ experience, I'm still confused by these the subtle difference between function overload resolution (which performs implicit conversion) and template argument deduction (which works with exact types).

    #cpp sucks #programming

    In conversation Saturday, 28-May-2022 17:49:23 UTC from mstdn.io permalink

    Attachments


    • Bernie (codewiz@mstdn.io)'s status on Saturday, 28-May-2022 17:52:32 UTC Bernie Bernie
      in reply to

      Before someone suggests circumventing the issue with a
      dynamically-sized std::span: the original code had two spans of different types, and I wanted to enforce them being the same size at the interface level:

      void decode(span<uint32_t, N> in, span<int32_t, N> out);

      A coworker suggested a clever solution. Can you guess it?

      #cpp #programming

      In conversation Saturday, 28-May-2022 17:52:32 UTC permalink
    • Bernie (codewiz@mstdn.io)'s status on Monday, 30-May-2022 00:43:43 UTC Bernie Bernie
      in reply to
      • lord pthenq1

      @pthenq1 Not sure if the recently introduced const genetics would pull this off, though... Would it be possible to deduce the static size of 2 slices of different types and force them to be the same number of elements with a compile-time check?

      In conversation Monday, 30-May-2022 00:43:43 UTC permalink
    • lord pthenq1 (pthenq1@mastodon.la)'s status on Monday, 30-May-2022 00:43:44 UTC lord pthenq1 lord pthenq1
      in reply to

      @codewiz

      Rust or lotion and peaceeee

      In conversation Monday, 30-May-2022 00:43:44 UTC permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • Privacy
  • Source
  • Version
  • Contact

Bobinas P4G is a social network. It runs on GNU social, version 2.0.1-beta0, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All Bobinas P4G content and data are available under the Creative Commons Attribution 3.0 license.