Skip to content

DoumanAsh/Result.cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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";

About

Result type for C++ inspired by Rust.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published