FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
co-cpp19/src/array19.lib/array19/Zip.test.cpp at develop · basicpp/co-cpp19 · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
basicpp
/
co-cpp19
Public
Notifications
You must be signed in to change notification settings
Fork
3
Star
14
Code
Issues
1
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
co-cpp19
/
src
/
array19.lib
/
array19
/
Zip.test.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
23 lines (20 loc) · 517 Bytes
Breadcrumbs
co-cpp19
/
src
/
array19.lib
/
array19
/
Zip.test.cpp
Copy path
File metadata and controls
23 lines (20 loc) · 517 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#
include
"
Zip.h
"
#
include
"
Array.h
"
using
namespace
array19
;
void
constexpr_Zip_test
() {
constexpr
auto
sum = [] {
auto
a = Array{
1
,
2
,
3
};
unsigned
b[] = {
4
,
5
,
6
};
auto
r =
0
;
#
ifdef
_MSC_VER
auto
z = Zip{a, b};
//
cl crashes if we inline this && run it as constexpr
for
(
auto
[va, vb] : z) {
#
else
for
(
auto
[va, vb] : Zip{a, b}) {
#endif
r += va * vb;
}
return
r;
}();
static_assert
(sum == (
1
*
4
) + (
2
*
5
) + (
3
*
6
));
}
Back
|
FazBrowse Home
|
New Git URL