0

I'm pretty confused about this code working:

#include <string>

int main() {
    int test1 = 0;
    std::string test2;

    std::move(test1);
    // move(test1);
    move(test2);

    return 0;
}

I did not put using namespace std anywhere, nor using std::move. And the weirdest thing in that, it only work with std::string! If I uncomment the commented line, it does not compile!

Can someone explain what's happening here? Thanks!

Live example on coliru

Guillaume Racicot
  • 39,621
  • 9
  • 77
  • 141

0 Answers0