Run Code  | API  | Code Wall  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

Policy based smart pointer

Language: Layout:
+ ] Compiler args + ] Show input
Compilation time: 0.39 sec, absolute service time: 0.58 sec (cached) 
fork mode |  history  | discussion
Error(s):
source_file.cpp: In instantiation of ‘SmartPtr<T, CheckingPolicy>::SmartPtr(const SmartPtr<T, ChkPolicy>&) [with ChkPolicy = FullCheckPolicy; T = int; CheckingPolicy = NoCheckPolicy]’:
source_file.cpp:102:47:   required from here
source_file.cpp:33:8: error: ‘int* SmartPtr<int, FullCheckPolicy>::p_’ is private
source_file.cpp:59:9: error: within this context
source_file.cpp: In instantiation of ‘SmartPtr<T, CheckingPolicy>& SmartPtr<T, CheckingPolicy>::operator=(const SmartPtr<T, ChkPolicy>&) [with ChkPolicy = NoCheckPolicy; T = int; CheckingPolicy = FullCheckPolicy; SmartPtr<T, CheckingPolicy> = SmartPtr<int, FullCheckPolicy>]’:
source_file.cpp:107:23:   required from here
source_file.cpp:33:8: error: ‘int* SmartPtr<int, NoCheckPolicy>::p_’ is private
source_file.cpp:66:9: error: within this context
source_file.cpp:67:5: warning: no return statement in function returning non-void [-Wreturn-type]
source_file.cpp: In instantiation of ‘SmartPtr<T, CheckingPolicy>& SmartPtr<T, CheckingPolicy>::operator=(const SmartPtr<T, ChkPolicy>&) [with ChkPolicy = FullCheckPolicy; T = int; CheckingPolicy = NoCheckPolicy; SmartPtr<T, CheckingPolicy> = SmartPtr<int, NoCheckPolicy>]’:
source_file.cpp:108:18:   required from here
source_file.cpp:33:8: error: ‘int* SmartPtr<int, FullCheckPolicy>::p_’ is private
source_file.cpp:66:9: error: within this context
source_file.cpp:67:5: warning: no return statement in function returning non-void [-Wreturn-type]

        

    
                
λ
.NET NoSQL database for rapid development