[ create a new paste ] login | about

Link: http://codepad.org/0lyaPrym    [ raw code | fork ]

Niels - C++, pasted on Jun 30:
 ////////////////////////////////////////

 namespace foo // "boost"
 {
  template<class T1, class T2>
  void swap(T1&, T2&)
  {
   // Trigger a compile error. 
   int staticAssert[sizeof(T1)!=sizeof(T2)] = {1};
  }
 }

 namespace bar // "std"
 {
  template<class T>
  void swap(T&, T&)
  {
   return; // okay.
  }

  class string {};
 }

 int main()
 {
  bar::string a1[42];
  bar::string a2[42];

  using foo::swap;
  swap(a1, a2);
 }

 ////////////////////////////////////////


Output:
No errors or program output.


Create a new paste based on this one


Comments: