cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
error C2039:string_view
Page 2
error C2039:string_view
Pages:
1
2
Jul 20, 2022 at 8:38am UTC
seeplus
(6597)
I'm not sure that VS2010 supports the {} for variable initialisation. It's a very old compiler. Try:
L9
size_t i = 0;
Same for L18.
Jul 20, 2022 at 1:11pm UTC
deleted account xyzzy
(5768)
Using {} for variable initialization is known as "Uniform Initialization" and was added in C++11.
https://mbevin.wordpress.com/2012/11/16/uniform-initialization/
VS2010 doesn't support C++11, that was added to VS2012 and later.
Without C++11 support there are a lot of key C++ features simply unavailable. That is why getting a newer C++ compiler is so critical.
Using Boost will help plug the gaps, though it isn't an ideal solution.
Jul 20, 2022 at 3:01pm UTC
Ganado
(6812)
If you're a beginner, why are you copying relatively complicated code that you didn't write?
Jul 21, 2022 at 11:10am UTC
kbw
(9488)
If you're a beginner, why are you copying relatively complicated code that you didn't write?
Maybe because the op is a beginner, and doesn't have the skill/experience to produce it?
Topic archived. No new replies allowed.
Pages:
1
2