I was reading the std and i can't figure out if this is possible at all . I want to have a local class in a function , one of the member functions is rather long so I want to implement it outside of the function.

#include <iostream>

using namespace std;

int foo(){

       class intClass{
                  int a, b;
                  intClass() {a=1; b=1;}
                  int doSome_over_a_b(){/* doSome_over_a_b */}
   intClass  X;
   int y=X.doSome_over_a_b();
   /*some other  foo stuff*/

   I want to put intClass::doSome_over_a_b
   here or in a *.C  file
int main (void)


How can I implement doSome_over_a_b outside of foo keeping the declaration in intClass as if it were a normal class ?