Created
October 31, 2018 16:02
-
-
Save loskutov/da66fed5de1a4923078efa20ad12ee8b to your computer and use it in GitHub Desktop.
A simple project where IWYU fails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "container.h" | |
IMPLEMENTATION_DEFINED_CONTAINER_TYPE container; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
// IMPLEMENTATION_DEFINED_CONTAINER_TYPE is guaranteed to fulfill some concept | |
// (say, SequenceContainer<int>) | |
#ifdef USE_DEQUE | |
#include <deque> | |
using IMPLEMENTATION_DEFINED_CONTAINER_TYPE = std::deque<int>; | |
#else | |
#include <vector> | |
using IMPLEMENTATION_DEFINED_CONTAINER_TYPE = std::vector<int>; | |
#endif | |
extern IMPLEMENTATION_DEFINED_CONTAINER_TYPE container; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "container.h" | |
#include <iostream> | |
int main() { | |
container.push_back(5); | |
auto it = container.begin(); | |
std::cout << *it; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment