Skip to content

Latest commit

 

History

History
28 lines (17 loc) · 573 Bytes

README.md

File metadata and controls

28 lines (17 loc) · 573 Bytes

Result.cpp

Build Status

Rusult type for C++ inspired by Rust.

WIP

Usage

You can just take header lib/result.hpp and place it into your project

#include <iostream>

#include "result.hpp"

decltype(auto) get_something() {
    //Do some work.

    return result::Result<int, std::string>::ok(1);
}

int main() {
    const auto result = get_something();

    std::cout << "Result=" << result.unwrap_or(0) << "\n";