Skip to content

Clashes with nonstd::variant by inplace_t types while compiling with MSVS 2017 #5

@flexferrum

Description

@flexferrum

The simple source:

#include <utility>
#include <iostream>
#include <nonstd/value_ptr.hpp>
#include <nonstd/variant.hpp>

struct TestStruct
{
	int a;
};

int main()
{
	nonstd::value_ptr<TestStruct> tmp(TestStruct{10});
	// std::variant<int, char> var;
	nonstd::variant<int, char> var2;
	
	std::cout << tmp->a << " " << var.index() << " " << var2.index() << std::endl;
	
	return 0;
}

It fails to compile with MSVS 2017 (19.15.26732.1 x64) either with 14th or 17th standard set. If I swap includes of value_ptr.hpp and variant.hpp everything goes fine. The similar bug is here:
https://onedrive.live.com/?authkey=%21AMtLKi_uWVjLFbM&cid=ECB37B93BA908BCE&id=ECB37B93BA908BCE%2116696&parId=root&o=OneUp
(line 2356).

Came from this discussion: jinja2cpp/Jinja2Cpp#80

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions