Skip to content

Commit cdf1c2d

Browse files
committed
refactor: work around sign conversion warning
1 parent 52a2798 commit cdf1c2d

File tree

6 files changed

+12
-3
lines changed

6 files changed

+12
-3
lines changed

include/cpp2util.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,9 +1526,7 @@ struct args_t : std::vector<std::string_view>
15261526
inline auto make_args(int argc, char const* const* argv) -> args_t
15271527
{
15281528
auto ret = args_t{argc, argv};
1529-
for (auto i = 0; i < argc; ++i) {
1530-
ret[i] = std::string_view{argv[i]};
1531-
}
1529+
std::copy(argv, argv + argc, ret.data());
15321530
return ret;
15331531
}
15341532

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
clang version 16.0.6 (https://github.com/llvm/llvm-project.git 7cbf1a2591520c2491aa35339f227775f4d3adf6)
2+
Target: x86_64-pc-linux-gnu
3+
Thread model: posix
4+
InstalledDir: /home/johel/root/clang-16/bin
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Bounds safety violation: out of bounds access attempt detected
2+
libc++abi: terminating
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Bounds safety violation
2+
libc++abi: terminating
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Contract violation: fill: value must contain at least count elements
2+
libc++abi: terminating
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Hello Fred with UFCS!

0 commit comments

Comments
 (0)