We have some strong aliases/typedefs like `UserId`, `UserName`, `EmoteName`, etc. Currently, they wrap a `QString`. In some cases, we don't want to use owned types. Notably, when looking up items in a map. There, it would be fine to look them up by `QStringView`. However, `QStringView` isn't "tagged" to contain a user ID, username, etc. This PR adds `-View` types as "tagged" versions of `QStringView`. So now `EmoteName` has a corresponding `EmoteNameView`. The view can be created from the owned type, and they can be compared to each other. The containers don't know about this relationship - for example, `std::unordered_map<EmoteName, V>` doesn't know that you can do lookup by `EmoteNameView`. To tell them, we need to provide both a transparent hasher (i.e. a hasher working for both types) and a transparent comparator. For the hasher, there's `EmoteNameHash` which forwards to the `QStringView` hash. For the comparison, [`std::equal_to<>`](https://en.cppreference.com/cpp/utility/functional/equal_to_void) can be used. See the tests for examples. Reviewed-by: pajlada <rasmus.karlsson@pajlada.com>
Chatterino 2

Chatterino 2 is a chat client for Twitch.tv. The Chatterino 2 wiki can be found here. Contribution guidelines can be found here.
Download
Current releases are available at https://chatterino.com. Windows users can also install Chatterino from Chocolatey.
Nightly build
You can download the latest Chatterino 2 build over here
You might also need to install the VC++ Redistributables from Microsoft if you do not have it installed already.
If you still receive an error about MSVCR120.dll missing, then you should install the VC++ 2013 Restributable.
Building
To get source code with required submodules run:
git clone --recurse-submodules https://github.com/Chatterino/chatterino2.git
or
git clone https://github.com/Chatterino/chatterino2.git
cd chatterino2
git submodule update --init --recursive
- Building on Windows
- Building on Windows with vcpkg
- Building on Linux
- Building on macOS
- Building on FreeBSD
Git blame
This project has big commits in the history which touch most files while only doing stylistic changes. To improve the output of git-blame, consider setting:
git config blame.ignoreRevsFile .git-blame-ignore-revs
This will ignore all revisions mentioned in the .git-blame-ignore-revs
file. GitHub does this by default.
Code style
The code is formatted using clang-format. Our configuration is found in the .clang-format file in the repository root directory.
For more contribution guidelines, take a look at the wiki.
Doxygen
Doxygen is used to generate project information daily and is available here.