Skip to content
This repository was archived by the owner on Jun 3, 2018. It is now read-only.
This repository was archived by the owner on Jun 3, 2018. It is now read-only.

expected<void> + return #18

@cdemez

Description

@cdemez

Hi, I tried to compile something like that, but I got a compilation error (MSVC2017):

"error C2561: 'initialize': function must return a value"

The code :

nonstd::expected<void, int> initialize() {
if (true)
return; // <-- Compilation error here

        // Here some processing  

}

Any idea to solve this case ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions