Skip to content

Instantly share code, notes, and snippets.

@fujii
Created August 21, 2018 03:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fujii/96ab8fef265870f36ad05c8faf7c3031 to your computer and use it in GitHub Desktop.
Save fujii/96ab8fef265870f36ad05c8faf7c3031 to your computer and use it in GitHub Desktop.
// reproducer of https://bugs.webkit.org/show_bug.cgi?id=188678#c19
#include <initializer_list>
template<typename T> class OptionSet {
public:
constexpr OptionSet() = default;
constexpr OptionSet(std::initializer_list<T> initializerList)
{
for (auto& option : initializerList) {
}
}
constexpr bool containsAny(OptionSet optionSet) const
{
return false;
}
};
enum TextCheckingType {
Quote,
};
void foo()
{
OptionSet<TextCheckingType> textCheckingOptions;
const bool shouldPerformReplacement = textCheckingOptions.containsAny({ TextCheckingType::Quote });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment