Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F1037746
helper.hpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
helper.hpp
View Options
/*
* This file is part of kazv.
* SPDX-FileCopyrightText: 2020 Tusooa Zhu <tusooa@kazv.moe>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
#pragma once
#include
<libkazv-config.hpp>
#include
<immer/config.hpp>
// https://github.com/arximboldi/immer/issues/168
#include
<QString>
#include
<zug/transducer/map.hpp>
namespace
Kazv
{
namespace
detail
{
struct
StrToQtT
{
template
<
class
T
>
auto
operator
()(
T
&&
x
)
{
return
QString
::
fromStdString
(
std
::
forward
<
T
>
(
x
));
}
};
struct
ContainerSizeT
{
template
<
class
T
>
auto
operator
()(
T
&&
x
)
->
int
{
return
std
::
forward
<
T
>
(
x
).
size
();
}
};
}
}
constexpr
auto
strToQt
=
zug
::
map
(
::
Kazv
::
detail
::
StrToQtT
{});
constexpr
auto
strListToQt
=
zug
::
map
([](
auto
container
)
{
return
zug
::
into
(
QStringList
{},
strToQt
,
std
::
move
(
container
));
});
constexpr
auto
containerSize
=
zug
::
map
(
::
Kazv
::
detail
::
ContainerSizeT
{});
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Wed, May 14, 7:44 AM (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
100490
Default Alt Text
helper.hpp (1 KB)
Attached To
Mode
rK kazv
Attached
Detach File
Event Timeline
Log In to Comment