• 0 Posts
  • 39 Comments
Joined 6 months ago
cake
Cake day: March 22nd, 2024

help-circle

  • You already can do that with C++20 concepts and the requires expression

    template <typename T>
    concept has_member_foo = requires(T t) {
        t.foo();
    };
    
    // Will fail to instantiate (with nice error 
    // message) if t.foo() is ill-formed
    template <has_member_foo T>
    void bar(T t) {
        // ...
    }
    
    // abbreviated form of above
    void baz(has_member_foo auto t) {
        // ...
    }
    
    // verbose form of above
    template <typename T> requires
        has_member_foo<T>
    void biz(T t) {
        // ...
    }
    
    // same as above but with anonymous concept
    template <typename T> requires
        requires(T t) { t.foo(); }
    void bom(T t) {
        // ...
    }
    
    // If already inside a function
    if constexpr (has_member_foo<T>) {
        // ...
    }
    
    // Same but with anonymous concept
    if constexpr (requires(T t) { t.foo(); }) {
        // ...
    }
    







  • Better than asking a dentist is asking a dental hygienist. Dentists are dental surgeons primarily concerned with solving specific problems with surgical intervention. Hygienists are oral health nurses concerned with preventive care and overall health and wellbeing.

    And listen to your hygienist. There is no cure-all toothpaste for everyone (eg not everyone needs anti-sensitivity toothpaste, the risk of erosion in whitening toothpastes might be a concern for some people, some people need higher fluoride concentrations, etc)







  • azi@mander.xyzto196@lemmy.blahaj.zoneInvention rule
    link
    fedilink
    arrow-up
    54
    ·
    2 months ago

    nah biology discoveries are always like “we thought this lesser spotted derpy pig didn’t have big enough spots. turns out it’s a new species” or “this protein turns out to be less curly and more squiggly when the fruit flies are having a lot of sex”


  • increasing Canada’s defence spending to two per cent of its gross domestic product, reforming immigration through “better gatekeepers,” making life more affordable by “dismantling protectionism” and increasing competition in the airline, telecommunications and agricultural sectors

    the party will have a strict vetting system to fend off potential foreign interference

    strict vetting against foreign interference is rich coming from a party that agrees with the US state department at every opportunity





  • A lot of regular bus services around the province are contracted out to private companies too. Translink runs their buses (Coast Mountain Bus Company) and BC Transit runs the buses in Victoria but all the other BC Transit branded buses are either run by municipalities (eg Nanaimo), regional districts (eg Cowichan Valley), or are privately run (eg First Transit in the Fraser Valley). Of course drivers in privately run areas usually get shafted, see the First Transit strike last year