[Development] QProperty and library coding guide

Thiago Macieira thiago.macieira at intel.com
Fri Jul 24 23:15:33 CEST 2020


On Friday, 24 July 2020 10:32:08 PDT Ville Voutilainen wrote:
> I don't know what the "sub-scope of a class" means.

struct S
{
    namespace prop1 {
        int operator()() const;
        void bind(std::function<void(int)> binding;
    };

private:
    int propvalue;
}

int S::prop1::operator()() const
{
    static_assert(std::is_same_v<decltype(*this), const S>);
    return propvalue;
}

int f(S *s)
{
    s->prop1.bind([](int) {});
    return s->prop1();
}

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel DPG Cloud Engineering





More information about the Development mailing list