Repository: microsoft/terminal
File: src/inc/til/winrt.h (C/C++)

Code before:
        property<T>(const T& defaultValue = details::winrt_empty_value<T>()) :
            _value{ defaultValue } {}

        property<T>& operator=(const property<T>& other) = default;

        T operator()() const
        {
            return _value;
        }
        void operator()(const T& value)
        {
            _value = value;
        }
        property<T>& operator=(const T& newValue)
        {
            _value = newValue;
            return *this;
        }
        operator bool() const requires std::is_same_v<T, winrt::hstring>
        {
            return !_value.empty();
        }
        operator bool() const requires std::convertible_to<T, bool>
        {
            return _value;
        }
        bool operator==(const property<T>& other) const
        {
            return _value == other._value;
        }
        bool operator!=(const property<T>& other) const
        {
            return _value != other._value;
        }
        bool operator==(const T& other) const
        {
            return _value == other;
        }
        bool operator!=(const T& other) const
        {
            return _value != other;
        }

    private:
        T _value;
    };

#ifdef WINRT_Windows_Foundation_H

    template<typename ArgsT>
    struct event

Review comment (suggestion):
It's much cheaper for the compiler if you use `if constexpr` over any alternatives. I assume it's because the contents of functions (like templates) are only evaluated when used (unlike concepts). Like so:
```suggestion
        operator bool() const noexcept
        {
            if constexpr (std::is_same_v<T, winrt::hstring>)
            {
                return !_value.empty();
            }
            else
            {
                return _value;
            }
        }
```

Code after:
            {
                return !_value.empty();
            }
            else
            {
                return _value;
            }
        }
        bool operator==(const property& other) const noexcept
        {
            return _value == other._value;
        }
        bool operator!=(const property& other) const noexcept
        {
            return _value != other._value;
        }
        bool operator==(const T& other) const noexcept
        {
            return _value == other;
        }
        bool operator!=(const T& other) const noexcept
        {
            return _value != other;
        }

    private:
        T _value;
    };

#ifdef WINRT_Windows_Foundation_H

    template<typename ArgsT>
    struct event
    {
        event<ArgsT>() = default;
        winrt::event_token operator()(const ArgsT& handler) { return _handlers.add(handler); }
        void operator()(const winrt::event_token& token) { _handlers.remove(token); }
        operator bool() const noexcept { return _handlers; }
        template<typename... Arg>
        void raise(auto&&... args)
        {
            _handlers(std::forward<decltype(args)>(args)...);
        }
        winrt::event<ArgsT> _handlers;
    };

    template<typename SenderT, typename ArgsT>
    struct typed_event
    {
        typed_event<SenderT, ArgsT>() = default;
        winrt::event_token operator()(const winrt::Windows::Foundation::TypedEventHandler<SenderT, ArgsT>& handler) { return _handlers.add(handler); }