Skip to content

how does one check to see whether a trait is true or false? #12

@robertramey

Description

@robertramey

I'm looking this over to address a problem I have and I have a question. Suppose I've define the is_incrementable as you have in your first example. What I would like to do is something like

template
std::enable_if<
is_incrementable::value // syntax for this?
int

fun(const T & i){
return ++i;
}

I'm expecting this is possible but I don't see it in the documentation. Please explain this to me.

Robert Ramey

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions