martinmoene/expected-lite

Issues compiling on Windows

vd3d opened this issue · 2 comments

vd3d commented

Hi,

I was using the version 0.0.2 and switched to 0.1.0 and I got a lot of compilation issues. I work with VS 2017. Noticed that I also use nonstd::optional !

It seems to have some conflicts !

Here is an extract of the errors I got :

c:\project\include\nonstd\expected.hpp(533): error C2011: 'nonstd::in_place_t': 'struct' type redefinition
c:\project\include\nonstd\optional.hpp(303): note: see declaration of 'nonstd::in_place_t'
c:\project\include\nonstd\expected.hpp(535): error C2079: 'in_place' uses undefined struct 'nonstd::in_place_t'
c:\project\include\nonstd\expected.hpp(535): error C2365: 'nonstd::in_place': redefinition; previous definition was 'function'

Duplicate of issue #14.

Currently expected-lite and optional-lite do not go together with respect to in-place construction. I've tried to use the approach of optional-lite (and several other -lite) here, but ran into issues, which is one reason it's not yet fixed.

Fixed via nonstd-lite issue 17: Align in_place between any, expected, optional, variant.