title: C++ - Find adjacent elements in std::map
body: <p>What is the most efficient way to look up the adjacent elements in a STL map using the examples I mention below:</p>
  
  <p>Suppose I have a map of integer - string:</p>
  
  <pre><code>1 -&gt; Test1
  5 -&gt; Test2
  10 -&gt; Test3
  20 -&gt; Test4
  50 -&gt; Test5
  </code></pre>
  
  <p>If I call:</p>
  
  <pre><code>get_adjacent(1) // Returns iterator to 1 and 5
  get_adjacent(2) // Returns iterator to 1 and 5
  get_adjacent(24) // Returns iterator to  20 and 50
  get_adjacent(50) // Returns iterator to 20 and 50
  </code></pre>