Here's what i tried to do: (with comparison to std::vector<int>
)
char s = 4;
std::vector<int> i;
std::vector<char> c;
i.insert(i.end(),{s+1,s+2,s+3}); // no warnings
c.insert(c.end(),{s+1,s+2,s+3}); // narrowing conversions of {s+1,s+2,s+3} from ints to chars
I know i can cast, but that gets ugly quickly. (especially with more arguments)
c.insert(c.end(),{(char)(s+1),(char)(s+2),(char)(s+3),(char)(s+4),(char)(s+5),(char)(s+6)});
Do we have to live with this? Or is there a better way?