zorael / kameloso

IRC bot with Twitch support
Boost Software License 1.0
8 stars 3 forks source link

mixin constraints #93

Closed zorael closed 4 years ago

zorael commented 4 years ago

This adds logic to help constrain mixin templates to statically only be allowed to be mixed into a specified type of scope. If it's mixed into the wrong type, it will static assert(0) with a helpful message.

enum MixinScope
{
    function_,  /// Mixed in inside a function.
    class_,     /// Mixed in inside a class.
    struct_,    /// Mixed in inside a struct.
    module_,    /// Mixed in inside a module.
}

This is a good candidate to move to lu, but let's merge it here first.