title: C++ - Finding intersection of two ranges
body: <p>What is the best way to find the intersection of two ranges in C++? For example, if I have one range as [1...20] inclusive, and another as [13...45] inclusive, I want to get [13...20], as that is the intersection between them. </p>
  
  <p>I thought about using the native set intersection function in C++, but I would first have to convert the range into a set, which would take too much computation time for large values.</p>