fixed template compilation on mingw

This commit is contained in:
fourtf 2018-01-28 15:28:02 +01:00
parent c62a91ac2b
commit 3d479e4c83
6 changed files with 10 additions and 9 deletions

View file

@ -273,14 +273,14 @@ HEADERS += \
src/util/networkrequest.hpp \
src/util/networkworker.hpp \
src/util/networkrequester.hpp \
src/util/flagsenum.h \
src/widgets/settingspages/ignoreuserspage.hpp \
src/widgets/settingspages/ignoremessagespage.hpp \
src/widgets/settingspages/specialchannelspage.hpp \
src/widgets/settingspages/keyboardsettings.hpp \
src/widgets/settingspages/keyboardsettingspage.hpp \
src/widgets/helper/titlebarbutton.hpp \
src/widgets/helper/label.hpp
src/widgets/helper/label.hpp \
src/util/flagsenum.hpp
RESOURCES += \
resources/resources.qrc

View file

@ -4,7 +4,7 @@
#include "messages/layouts/messagelayoutelement.hpp"
#include "messages/message.hpp"
#include "messages/selection.hpp"
#include "util/flagsenum.h"
#include "util/flagsenum.hpp"
#include <QPixmap>

View file

@ -1,7 +1,7 @@
#pragma once
#include "messages/messageelement.hpp"
#include "util/flagsenum.h"
#include "util/flagsenum.hpp"
#include "widgets/helper/scrollbarhighlight.hpp"
#include <cinttypes>

View file

@ -21,8 +21,7 @@ public:
void appendTimestamp(const QTime &time);
QString matchLink(const QString &string);
template <typename T, typename... Args,
typename _ = std::enable_if<std::is_base_of<MessageElement, T>::value>::type>
template <typename T, typename... Args>
T *emplace(Args &&... args)
{
static_assert(std::is_base_of<MessageElement, T>::value, "T must extend MessageElement");

View file

@ -34,7 +34,8 @@ void LoggingManager::addMessage(const QString &channelName, messages::MessagePtr
if (it == this->loggingChannels.end()) {
auto channel = new LoggingChannel(channelName, this->getDirectoryForChannel(channelName));
channel->addMessage(message);
this->loggingChannels.emplace(channelName, std::move(channel));
this->loggingChannels.emplace(channelName,
std::unique_ptr<LoggingChannel>(std::move(channel)));
} else {
it->second->addMessage(message);
}

View file

@ -5,8 +5,9 @@
namespace chatterino {
namespace util {
template <typename T, typename _ = std::enable_if<std::is_enum<T>::value>::type,
typename Q = std::underlying_type<T>::type>
// = std::enable_if<std::is_enum<T>::value>::type
template <typename T, typename Q = typename std::underlying_type<T>::type>
class FlagsEnum
{
public: