-
-
Notifications
You must be signed in to change notification settings - Fork 262
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
The following code produces wrong insight:
#include <iostream>
#include <type_traits>
int main() {
std::cout << std::is_same_v<void(int), void(const int)> << '\n';
std::cout << std::is_same_v<void(int*), void(const int*)> << '\n';
}
||
v
#include <iostream>
#include <type_traits>
int main()
{
std::operator<<(std::cout.operator<<(std::is_same_v), '\n');
std::operator<<(std::cout.operator<<(std::is_same_v), '\n');
}
While this example is okay:
#include <iostream>
#include <type_traits>
int main() {
std::cout << std::is_same<void(int), void(const int)>::value << '\n';
std::cout << std::is_same<void(int*), void(const int*)>::value << '\n';
}
||
v
#include <iostream>
#include <type_traits>
int main()
{
std::operator<<(std::cout.operator<<(std::integral_constant<bool, true>::value), '\n');
std::operator<<(std::cout.operator<<(std::integral_constant<bool, false>::value), '\n');
}
It's taken from the 254th C++ Quiz question, btw.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working