New OOTS products from CafePress
New OOTS t-shirts, ornaments, mugs, bags, and more
Results 1 to 3 of 3
  1. - Top - End - #1
    Barbarian in the Playground
     
    OldWizardGuy

    Join Date
    Nov 2010
    Location
    California
    Gender
    Male

    Default Practicing C++ Templates

    I want to get better at C++ templates. I can do the basics:

    Code:
    template<typename T>
    T& min(T& t1, T& t2) {
      return t1 < t2 ? t1 : t2;
    }
    but I'm not great at parameter packs and <concepts>.

    Does anyone know a good place to get practice? What I'd really love is something like leetcode, but focused on C++ templates instead of algorithms.

  2. - Top - End - #2
    Ettin in the Playground
     
    OldWizardGuy

    Join Date
    Aug 2010

    Default Re: Practicing C++ Templates

    What's your overall knowledge of c++?
    "Gosh 2D8HP, you are so very correct (and also good looking)"

  3. - Top - End - #3
    Barbarian in the Playground
     
    OldWizardGuy

    Join Date
    Nov 2010
    Location
    California
    Gender
    Male

    Default Re: Practicing C++ Templates

    Very strong -- I've been using C++ professionally for over two decades. I can tell you about std::optional and string_view, explain the one-definition rule, and know what std::move actually does. I can write an overload and an override. I've crashed std::sort and I've signal-handled a segfault. I can even fake my way through an explanation of memory_order_relaxed vs. memory_order_acquire/memory_order_release vs. memory_order_seq_cst.

    But I haven't had much chance to play with templates after the C++11 improvements, so I wanted to work on that.

Posting Permissions

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