-
-
Notifications
You must be signed in to change notification settings - Fork 649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print vector content. #170
Comments
Is the specialization of // doctest_proxy.h
#pragma once
#include <doctest.h>
// the specialization of StringMaker<std::vector<T>> and include it instead of the framework header directly. Perhaps I should edit the documentation if this is the problem (the specialization being present in only one of the translation units) - this might be due to ODR. |
That was indeed the problem. Thank-you. |
Should I suggest some documentation changes wrt this issue? I've spent numerous hours trying to figure out why my custom stringification functions seem to randomly work in some files but not in others (well, I learned that you can do ODR violations with function overloads and template specializations, so it wasn't a completely wasted time, but well...). |
Description
I am trying to print std::vector content on failure.
E.g.:
REQUIRE(std::vector<int>{1} == std::vector<int>{1,2});
Should produce to following output.
Here is my attempt:
It works well at first but as soon as I add more translation units with more tests it starts failing and printing the default way:
Steps to reproduce
It is kind of hard to reproduce as the output is shown only on failure and it keeps failing after some time.
Extra information
The text was updated successfully, but these errors were encountered: