Here is the problem I encountered when trying recently to fiddle with `private` invocation outsie from the context of class members:

```
#include <iostream>
#include <exception>

class TestClass {  
    private: int var;    
};

int main() {  
    TestClass test;  
    try {  
       test.var;  
    }
    catch( std::exception& e) {  
        std::cout << "why does this not occur ?";  
    }  
return 0; 
}

```

The error is reasonable `error: ‘int TestClass::var’ is private within this context test.var;` therefor I tried to wrap the call within a template class to avoid the error being intellisensed.

```
#include <iostream>
#include <exception>

class TestClass {
  private:
    int var;
};

template <class t>
void foo() {
    t cl;
    try {
        cl.var;
      }
    catch (std::exception& e) {
        std::cout << "why does this not occur ?";
      }
    return;
}

int main() { 
    foo<TestClass>();
    return 0;
}

```

This lame access attempt to this poor private variable area always leads to some compile-time violation error, `SFINAE` getarround doesn't seem to get anything resolved, I tried to just remote-sniff the accessibility to `Class::var` type always using templating:

```
#include <iostream>
#include <exception>
#include <type_traits>
#include <cstdint>

class TestClass
{
private:
    int var;
};

template <class C>
int hasmember() { 
    int ret=0;
    try {
        ret= std::is_same<decltype(C::var), int>::value;
    }
    catch (std::exception& e)
    {
        std::cout << "why does this not occur ?";
    }
    return ret; 
}

int main() {
    TestClass cl;
    printf("%s", hasmember<TestClass>()?"yes":"no");
}

```

The error-console is pale, and the program outputs "yes" not making sign of anything caugth within the context of an exception. 

While its uninterceptability within try/exception clause is not well explainable for me, Why the compiler doesn't allow the code to execute and is there any flag to raise for g++ force it to run ?