Demo entry 6760004

attributes C++17

   

Submitted by cpp17 on Sep 06, 2018 at 08:23
Language: C++. Code size: 582 Bytes.

void f() {
    [[rpr::kernel, rpr::target(cpu,gpu)]] // repetition
    dotask();
}

void f() {
    [[using rpr: kernel, target(cpu,gpu)]]
    dotask();
}

// on enumerations:
enum class ColorModes
{
    RGB [[deprecated("use RGB8")]],
    RGBA [[deprecated("use RGBA8")]],
    RGBA16F,
    RGB8,
    RGBA8
};

enum class [[nodiscard]] ErrorCode {
    OK,
    Fatal,
    System,
    FileIssue
};

// on namespaces:
namespace [[deprecated("use BetterUtils namespace")]] GoodUtils {
    void DoStuff() { }
}

// nodiscard
[[nodiscard]] int Compute();

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).