Code 1 is more efficient when container.size()
is faster.
However, container.size()
is fast only when the container is vector
Other containers such as list
or map
are written like code 2 because this operation is slow.
Code 1 must be accessed within the repeat statement, such as Telem=some_vector[i];
.
For this to be possible, the container must support operator[](std::size_t)
This is also not supported by other container types except vector
.
567 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
888 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
573 Understanding How to Configure Google API Key
600 GDB gets version error when attempting to debug with the Presense SDK (IDE)
© 2024 OneMinuteCode. All rights reserved.