User Tools

Site Tools


programming:cpp:container

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
programming:cpp:container [2022/05/06 17:21]
odagawa
programming:cpp:container [2022/05/06 17:25] (current)
odagawa
Line 16: Line 16:
  
 <code cpp> <code cpp>
 +#include <iostream>
 #include <vector> #include <vector>
  
Line 215: Line 216:
 <code cpp> <code cpp>
 #include <iostream> #include <iostream>
 +#include <vector>
 #include <utility> #include <utility>
  
Line 234: Line 236:
   // ただし,実際には int ではなく,plate などで大小関係が決まった構造体を詰めている   // ただし,実際には int ではなく,plate などで大小関係が決まった構造体を詰めている
      
-  // ある basetrack からつながるすべての basetrack を列挙したい. +  // ある basetrack からつながるすべての basetrack を列挙する. 
-  // ()+  int target = 100; 
 +  if ( linklet.find(target) != linklet.end() ) { 
 +    auto range = linklet.equal_range(target); 
 +    for ( auto itr = range.first; itr != range.second; itr++ ) { 
 +      std::cout << (*itr).second << std::endl; 
 +    } 
 +  } 
 + 
 +  std::exit(0);
  
 } }
  
 </code> </code>
programming/cpp/container.1651857672.txt.gz · Last modified: 2022/05/06 17:21 by odagawa