Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Quincunx271/nickel

Open more actions menu

Repository files navigation

Nickel

Nickel provides an alternative named parameter syntax for function calls.

Example

#include <nickel/nickel.hpp>

// Declare the names
NICKEL_NAME(width_name, width);
NICKEL_NAME(height_name, height);

// Declare the function
auto rectangle_area() {
    return nickel::wrap(width_name, height_name)([](int width, int height) {
        // The actual definition of the function
        return width * height;
    });
}

int foo() {
    // Call the function
    return rectangle_area()
        .width(42)      // Bind named arguments
        .height(35)();  // Bind `height`, then perform the actual call
    // Returns 42 * 35 = 1470
}

Documentation

See the documentation at: https://quincunx271.github.io/nickel/

Releases

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.