swap Function (STL)

Swaps the contents of two files.

inline void swap(
   path& Left,
   path& Right
);

Parameters

  • Left
    The left path object.

  • Right
    The right path object.

Remarks

The function modifies the file system, not just the path objects. It performs the swap by renaming Left as Right and Right as Left.

Requirements

Header: filesystem

Namespace: std::tr2::sys

See Also

Reference

<filesystem>

path::swap Method

Other Resources

C++ Standard Library Header Files