You don’t need initialization lists for that:
std::vector<int> vector1(length, 0);
std::vector<double> vector2(length, 0.0);
More Related Contents:
- Passing capturing lambda as function pointer
- How std::function works
- Why do we copy then move?
- Clang doesn’t see basic headers
- Difference between std::function and a standard function pointer? [duplicate]
- What is the recommended way to align memory in C++11
- Using std::make_unique with a custom deleter
- Why vector access operators are not specified as noexcept?
- “to_string” isn’t a member of “std”?
- using SFINAE for template class specialisation
- How can I pass a C++ lambda to a C-callback that expects a function pointer and a context?
- Timeout for thread.join()
- I want to kill a std::thread using its thread object? [duplicate]
- What expressions create xvalues?
- Why does the template-id in “A=0” not compile without space because of the greater-or-equal-than operator “>=”?
- Specializing a template on a lambda in C++0x
- constexpr not working if the function is declared inside class scope
- What’s the standard/official name for universal references?
- Is Visual Studio 2013 optimizing correctly in the presence of /OPT:ICF?
- thread safety of MPI send using threads created with std::async
- Overloading on R-value references and code duplication
- Visual Studio 2008 with c++11
- Regex not working as expected with C++ regex_match
- Unable to print the value of nullptr on screen
- std::thread Why object is copied twice?
- Need iterator when using range-based for loops
- How do I typedef a function pointer with the C++11 using syntax?
- Can using a lambda in header files violate the ODR?
- template parameter packs access Nth type and Nth element
- Can the ‘type’ of a lambda expression be expressed?