Reference of vector as an argument

Hi, expert

I have a problem about reference of vector as an argument.

I defined one function, like:

fun(const std::vector<int>& Integers)

this function is built into one dll (debug build and release build) and will be called by other application.

When I call this function in an application, I call it like this:

std::vector<int> Integers;
Integers.push_back(0); //size of vector is 1
fun(Integers);

The problem is:
when I use the debug build of that dll, I can pass the vector to the function correctly; but when I use the release build of that dll, it pass an incorrect vector (the size is larger than 1 and with random elements).

How can I solve this problem?

Thanks in advance!
Topic archived. No new replies allowed.