Submit Search
Upload
C++ extension methods
•
0 likes
•
3,560 views
P
phil_nash
Follow
A 5 minute (or just over) lightning talk I did at ACCU2013
Read less
Read more
Technology
Health & Medicine
Slideshow view
Report
Share
Slideshow view
Report
Share
1 of 26
Download now
Download to read offline
Recommended
Alteryxの空間分析で学ぶ、最寄りの指定緊急避難場所と低水位地帯 Developers.IO Tokyo 2019
Alteryxの空間分析で学ぶ、最寄りの指定緊急避難場所と低水位地帯 Developers.IO Tokyo 2019
Yuji Kanemoto
2 7(24)目標管理
2 7(24)目標管理
志銘 姚
基礎から見直す ASP.NET MVC の単体テスト自動化方法 ~ Windows Azure 関連もあるかも~
基礎から見直す ASP.NET MVC の単体テスト自動化方法 ~ Windows Azure 関連もあるかも~
normalian
Schema Definitions and Overlays for Self-Sovereign Identity (SSI) - Paul Knowles
Schema Definitions and Overlays for Self-Sovereign Identity (SSI) - Paul Knowles
SSIMeetup
Chapter 1-直線運動-2018
Chapter 1-直線運動-2018
阿Samn的物理課本
【CNDT2020】Tunaclo API Connectで実現する次世代のクラウド間アクセス
【CNDT2020】Tunaclo API Connectで実現する次世代のクラウド間アクセス
Kei Furusawa
Тема №4 Сектор B2B
Тема №4 Сектор B2B
Oleg Nazarevych
お金が無いときのMySQL Cluster頼み
お金が無いときのMySQL Cluster頼み
aoike
Recommended
Alteryxの空間分析で学ぶ、最寄りの指定緊急避難場所と低水位地帯 Developers.IO Tokyo 2019
Alteryxの空間分析で学ぶ、最寄りの指定緊急避難場所と低水位地帯 Developers.IO Tokyo 2019
Yuji Kanemoto
2 7(24)目標管理
2 7(24)目標管理
志銘 姚
基礎から見直す ASP.NET MVC の単体テスト自動化方法 ~ Windows Azure 関連もあるかも~
基礎から見直す ASP.NET MVC の単体テスト自動化方法 ~ Windows Azure 関連もあるかも~
normalian
Schema Definitions and Overlays for Self-Sovereign Identity (SSI) - Paul Knowles
Schema Definitions and Overlays for Self-Sovereign Identity (SSI) - Paul Knowles
SSIMeetup
Chapter 1-直線運動-2018
Chapter 1-直線運動-2018
阿Samn的物理課本
【CNDT2020】Tunaclo API Connectで実現する次世代のクラウド間アクセス
【CNDT2020】Tunaclo API Connectで実現する次世代のクラウド間アクセス
Kei Furusawa
Тема №4 Сектор B2B
Тема №4 Сектор B2B
Oleg Nazarevych
お金が無いときのMySQL Cluster頼み
お金が無いときのMySQL Cluster頼み
aoike
OODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objects
Shanmuganathan C
富士通によるFIDOソリューションの展開について
富士通によるFIDOソリューションの展開について
FIDO Alliance
Zero-Knowledge Proofs in Light of Digital Identity
Zero-Knowledge Proofs in Light of Digital Identity
Clare Nelson, CISSP, CIPP-E
маркетинговая стратегия. презентация для клиента
маркетинговая стратегия. презентация для клиента
Se_Grey
【一般社員向け研修】ソリューション営業活動プロセスの理解と実践ノウハウ
【一般社員向け研修】ソリューション営業活動プロセスの理解と実践ノウハウ
Masanori Saito
次世代 IDaaS のポイントは本人確認 NIST と、サプライチェーンセキュリティと、みなしご ID - OpenID Summit 2020
次世代 IDaaS のポイントは本人確認 NIST と、サプライチェーンセキュリティと、みなしご ID - OpenID Summit 2020
OpenID Foundation Japan
風險管理與危機管理 馬偕-Final-無動畫
風險管理與危機管理 馬偕-Final-無動畫
Alex Yin
現場料品管理 material control
現場料品管理 material control
Fast SiC Semiconductor Inc.
Global Gender Gap Report 2023
Global Gender Gap Report 2023
Paperjam_redaction
見えてきた!? Windows Virtual Desktop のしくみ
見えてきた!? Windows Virtual Desktop のしくみ
Takashi Ushigami
問題處理與策略規劃技巧 (淡江大學)
問題處理與策略規劃技巧 (淡江大學)
Yeong-Long Chen
0x002 - Windows Priv Esc - A Low Level Explanation of Token Theft
0x002 - Windows Priv Esc - A Low Level Explanation of Token Theft
Russell Sanford
UX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and Archives
Ned Potter
TDLS8000 Tunable Diode Laser Spectrometer
TDLS8000 Tunable Diode Laser Spectrometer
Yokogawa
Soil Degradation
Soil Degradation
Michael Newbold
Participatory extension method
Participatory extension method
G B Pant University of Agriculture & Technology, Pantnagar, (U S Nagar), Uttarakhand, India
Extension approaches
Extension approaches
Marxism
Farmer Management System
Farmer Management System
Technical Centre for Agricultural and Rural Cooperation ACP-EU (CTA)
Farm management
Farm management
Nadia
Stomatal function and cam photosynthesis
Stomatal function and cam photosynthesis
Mark McGinley
AGRI 4411 Farm Management Chapter 2
AGRI 4411 Farm Management Chapter 2
Rita Conley
2nd lecture on Farm Management
2nd lecture on Farm Management
Ministry of Animal Resources & Fisheries
More Related Content
What's hot
OODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objects
Shanmuganathan C
富士通によるFIDOソリューションの展開について
富士通によるFIDOソリューションの展開について
FIDO Alliance
Zero-Knowledge Proofs in Light of Digital Identity
Zero-Knowledge Proofs in Light of Digital Identity
Clare Nelson, CISSP, CIPP-E
маркетинговая стратегия. презентация для клиента
маркетинговая стратегия. презентация для клиента
Se_Grey
【一般社員向け研修】ソリューション営業活動プロセスの理解と実践ノウハウ
【一般社員向け研修】ソリューション営業活動プロセスの理解と実践ノウハウ
Masanori Saito
次世代 IDaaS のポイントは本人確認 NIST と、サプライチェーンセキュリティと、みなしご ID - OpenID Summit 2020
次世代 IDaaS のポイントは本人確認 NIST と、サプライチェーンセキュリティと、みなしご ID - OpenID Summit 2020
OpenID Foundation Japan
風險管理與危機管理 馬偕-Final-無動畫
風險管理與危機管理 馬偕-Final-無動畫
Alex Yin
現場料品管理 material control
現場料品管理 material control
Fast SiC Semiconductor Inc.
Global Gender Gap Report 2023
Global Gender Gap Report 2023
Paperjam_redaction
見えてきた!? Windows Virtual Desktop のしくみ
見えてきた!? Windows Virtual Desktop のしくみ
Takashi Ushigami
問題處理與策略規劃技巧 (淡江大學)
問題處理與策略規劃技巧 (淡江大學)
Yeong-Long Chen
0x002 - Windows Priv Esc - A Low Level Explanation of Token Theft
0x002 - Windows Priv Esc - A Low Level Explanation of Token Theft
Russell Sanford
What's hot
(12)
OODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objects
富士通によるFIDOソリューションの展開について
富士通によるFIDOソリューションの展開について
Zero-Knowledge Proofs in Light of Digital Identity
Zero-Knowledge Proofs in Light of Digital Identity
маркетинговая стратегия. презентация для клиента
маркетинговая стратегия. презентация для клиента
【一般社員向け研修】ソリューション営業活動プロセスの理解と実践ノウハウ
【一般社員向け研修】ソリューション営業活動プロセスの理解と実践ノウハウ
次世代 IDaaS のポイントは本人確認 NIST と、サプライチェーンセキュリティと、みなしご ID - OpenID Summit 2020
次世代 IDaaS のポイントは本人確認 NIST と、サプライチェーンセキュリティと、みなしご ID - OpenID Summit 2020
風險管理與危機管理 馬偕-Final-無動畫
風險管理與危機管理 馬偕-Final-無動畫
現場料品管理 material control
現場料品管理 material control
Global Gender Gap Report 2023
Global Gender Gap Report 2023
見えてきた!? Windows Virtual Desktop のしくみ
見えてきた!? Windows Virtual Desktop のしくみ
問題處理與策略規劃技巧 (淡江大學)
問題處理與策略規劃技巧 (淡江大學)
0x002 - Windows Priv Esc - A Low Level Explanation of Token Theft
0x002 - Windows Priv Esc - A Low Level Explanation of Token Theft
Viewers also liked
UX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and Archives
Ned Potter
TDLS8000 Tunable Diode Laser Spectrometer
TDLS8000 Tunable Diode Laser Spectrometer
Yokogawa
Soil Degradation
Soil Degradation
Michael Newbold
Participatory extension method
Participatory extension method
G B Pant University of Agriculture & Technology, Pantnagar, (U S Nagar), Uttarakhand, India
Extension approaches
Extension approaches
Marxism
Farmer Management System
Farmer Management System
Technical Centre for Agricultural and Rural Cooperation ACP-EU (CTA)
Farm management
Farm management
Nadia
Stomatal function and cam photosynthesis
Stomatal function and cam photosynthesis
Mark McGinley
AGRI 4411 Farm Management Chapter 2
AGRI 4411 Farm Management Chapter 2
Rita Conley
2nd lecture on Farm Management
2nd lecture on Farm Management
Ministry of Animal Resources & Fisheries
Pra methods
Pra methods
kppaul2009
Soil degradation and regeneration
Soil degradation and regeneration
Bijesh Mishra
Poultry Farm Management System
Poultry Farm Management System
bimoljit
Web Based Agriculture Information System
Web Based Agriculture Information System
Gihan Wikramanayake
Agricultural Extension and Communication
Agricultural Extension and Communication
Karl Obispo
Participatory Research and Extension Approaches (PREA)
Participatory Research and Extension Approaches (PREA)
africa-rising
Current approaches in extension
Current approaches in extension
Yagnesh sondarva
Performance Management System
Performance Management System
Mayank Singh
Soil degradation
Soil degradation
Dhakshinamoorthy Maikandadevan
Final ppt
Final ppt
Jyoti Jha
Viewers also liked
(20)
UX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and Archives
TDLS8000 Tunable Diode Laser Spectrometer
TDLS8000 Tunable Diode Laser Spectrometer
Soil Degradation
Soil Degradation
Participatory extension method
Participatory extension method
Extension approaches
Extension approaches
Farmer Management System
Farmer Management System
Farm management
Farm management
Stomatal function and cam photosynthesis
Stomatal function and cam photosynthesis
AGRI 4411 Farm Management Chapter 2
AGRI 4411 Farm Management Chapter 2
2nd lecture on Farm Management
2nd lecture on Farm Management
Pra methods
Pra methods
Soil degradation and regeneration
Soil degradation and regeneration
Poultry Farm Management System
Poultry Farm Management System
Web Based Agriculture Information System
Web Based Agriculture Information System
Agricultural Extension and Communication
Agricultural Extension and Communication
Participatory Research and Extension Approaches (PREA)
Participatory Research and Extension Approaches (PREA)
Current approaches in extension
Current approaches in extension
Performance Management System
Performance Management System
Soil degradation
Soil degradation
Final ppt
Final ppt
Similar to C++ extension methods
An Introduction to Part of C++ STL
An Introduction to Part of C++ STL
乐群 陈
Oop objects_classes
Oop objects_classes
sidra tauseef
include ltfunctionalgt include ltiteratorgt inclu.pdf
include ltfunctionalgt include ltiteratorgt inclu.pdf
naslin841216
C++11 - STL Additions
C++11 - STL Additions
GlobalLogic Ukraine
C++11 - A Change in Style - v2.0
C++11 - A Change in Style - v2.0
Yaser Zhian
Templates in C++
Templates in C++
Tech_MX
Please code in C++ and do only the �TO DO�s and all of them. There a.pdf
Please code in C++ and do only the �TO DO�s and all of them. There a.pdf
farankureshi
Monadic Comprehensions and Functional Composition with Query Expressions
Monadic Comprehensions and Functional Composition with Query Expressions
Chris Eargle
Алексей Кутумов, Вектор с нуля
Алексей Кутумов, Вектор с нуля
Sergey Platonov
Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...
Codemotion
C++11
C++11
Sasha Goldshtein
TDC2016POA | Trilha .NET - C# como você nunca viu: conceitos avançados de pro...
TDC2016POA | Trilha .NET - C# como você nunca viu: conceitos avançados de pro...
tdc-globalcode
Статичный SQL в С++14. Евгений Захаров ➠ CoreHard Autumn 2019
Статичный SQL в С++14. Евгений Захаров ➠ CoreHard Autumn 2019
corehard_by
Matuura cpp
Matuura cpp
matuura_core
The STL
The STL
adil raja
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
DIPESH30
C++ Lambda and concurrency
C++ Lambda and concurrency
명신 김
C++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdf
yamew16788
Functional C++
Functional C++
Kevlin Henney
Aho-Corasick string matching algorithm
Aho-Corasick string matching algorithm
Takatoshi Kondo
Similar to C++ extension methods
(20)
An Introduction to Part of C++ STL
An Introduction to Part of C++ STL
Oop objects_classes
Oop objects_classes
include ltfunctionalgt include ltiteratorgt inclu.pdf
include ltfunctionalgt include ltiteratorgt inclu.pdf
C++11 - STL Additions
C++11 - STL Additions
C++11 - A Change in Style - v2.0
C++11 - A Change in Style - v2.0
Templates in C++
Templates in C++
Please code in C++ and do only the �TO DO�s and all of them. There a.pdf
Please code in C++ and do only the �TO DO�s and all of them. There a.pdf
Monadic Comprehensions and Functional Composition with Query Expressions
Monadic Comprehensions and Functional Composition with Query Expressions
Алексей Кутумов, Вектор с нуля
Алексей Кутумов, Вектор с нуля
Laziness, trampolines, monoids and other functional amenities: this is not yo...
Laziness, trampolines, monoids and other functional amenities: this is not yo...
C++11
C++11
TDC2016POA | Trilha .NET - C# como você nunca viu: conceitos avançados de pro...
TDC2016POA | Trilha .NET - C# como você nunca viu: conceitos avançados de pro...
Статичный SQL в С++14. Евгений Захаров ➠ CoreHard Autumn 2019
Статичный SQL в С++14. Евгений Захаров ➠ CoreHard Autumn 2019
Matuura cpp
Matuura cpp
The STL
The STL
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
lab08build.bat@echo offclsset DRIVE_LETTER=1s.docx
C++ Lambda and concurrency
C++ Lambda and concurrency
C++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdf
Functional C++
Functional C++
Aho-Corasick string matching algorithm
Aho-Corasick string matching algorithm
Recently uploaded
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
Deakin University
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
Enterprise Knowledge
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
null - The Open Security Community
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
Mark Billinghurst
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Wonjun Hwang
costume and set research powerpoint presentation
costume and set research powerpoint presentation
phoebematthew05
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April Automation LPDG
MarianaLemus7
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
Fwdays
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
Sinan KOZAK
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
Fwdays
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
carlostorres15106
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
2toLead Limited
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
Dubai Multi Commodity Centre
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
Addepto
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
jimielynbastida
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
Padma Pradeep
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
BookNet Canada
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
Ridwan Fadjar
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
UiPathCommunity
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
comworks
Recently uploaded
(20)
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
costume and set research powerpoint presentation
costume and set research powerpoint presentation
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April Automation LPDG
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
C++ extension methods
1.
C++ Ext
e n s i o @phil_nash n Methods
2.
class A: foo()
bar() data
3.
class A: foo()
+ explode() ? bar() data
4.
Dynamic languages?
5.
setattr(cls, func.__name__,
types.MethodType(func, cls))
6.
setattr(cls, func.__name__,
types.MethodType(func, cls)) var a = {}; a.f1 = function(){};
7.
setattr(cls, func.__name__,
types.MethodType(func, cls)) var a = {}; a.f1 = function(){}; struct objc_method myMethod; myMethod.method_name = sel_registerName("sayHello"); myMethod.method_imp = sayHello; struct objc_method_list * myMethodList; myMethodList = malloc (sizeof(struct objc_method_list)); myMethodList-‐>method_count = 1; myMethodList-‐>method_list[0] = myMethod; class_addMethods ( [EmptyClass class], myMethodList );
8.
Static languages?
9.
namespace ExtensionMethods {
public static class MyExtensions { public static int WordCount(this String str) { return str.Split(new char[] { ' ', '.', '?' }, StringSplitOptions.RemoveEmptyEntries).Length; } } }
10.
namespace ExtensionMethods {
public static class MyExtensions { public static int WordCount(this String str) { return str.Split(new char[] { ' ', '.', '?' }, StringSplitOptions.RemoveEmptyEntries).Length; } } } @implementation NSString (reverse) -(NSString *) reverseString { NSMutableString *reversedStr; int len = [self length]; reversedStr = [NSMutableString stringWithCapacity:len]; while (len > 0) [reversedStr appendString: [NSString stringWithFormat:@"%C", [self characterAtIndex:--len]]]; return reversedStr; }
11.
C++ ?
12.
The C++
Interface principle
13.
namespace NS {
class T { }; void f( T ); } int main() { NS::T object; f(object); }
14.
namespace NS {
class T { }; void f( T ); } int main() { NS::T object; object.f(); }
15.
namespace NS {
class T { }; void f( T ); } int main() { NS::T* object = new NS::T(); object-‐>f(); }
16.
object-‐>f()
17.
object<-‐f()
18.
19.
struct Widget :
Extendible<Widget> { Widget( int size, int weight ) : size( size ), weight( weight ) {} int size; int weight; };
20.
struct Widget :
Extendible<Widget> { Widget( int size, int weight ) : size( size ), weight( weight ) {} int size; int weight; }; struct print : ExtMethod<print> { void operator()( Widget& w ) { std::cout << "size: " << w.size << ", weight: " << w.weight << std::endl; } }; Widget w( 4, 10 ); w<-print();
21.
struct Widget :
Extendible<Widget> { Widget( int size, int weight ) : size( size ), weight( weight ) {} int size; int weight; }; struct print : ExtMethod<print> { void operator()( Widget& w ) { std::cout << "size: " << w.size << ", weight: " << w.weight << std::endl; } }; struct density : ExtMethod<density, float> { float operator()( Widget& w ) { return (float)(w.weight / w.size); } }; Widget w( 4, 10 ); w<-print(); float d = w<-density();
22.
23.
template<typename T, typename
ReturnT=void> struct ExtMethod { ExtMethod& operator - () { return *this; } template<typename U> ReturnT operator()( U& obj ) { return static_cast<T*>(this)->operator()( obj ); } }; template<typename Derived> struct Extendible { template<typename T, typename ReturnT> ReturnT operator < ( ExtMethod<T, ReturnT>& extMethod ) { return extMethod( static_cast<Derived&>( *this ) ); } };
24.
25.
template<typename T, typename
ReturnT=void> struct ExtMethod { ExtMethod& operator - () { return *this; } template<typename U> ReturnT operator()( U& obj ) { return static_cast<T*>(this)->operator()( obj ); } }; template<typename Derived> struct Extendible { template<typename T, typename ReturnT> ReturnT operator < ( ExtMethod<T, ReturnT>& extMethod ) { return extMethod( static_cast<Derived&>( *this ) ); } };
26.
template<typename T, typename
ReturnT=void> struct ExtMethod { e! ExtMethod& operator - () { } return *this; c od template<typename U> ion ct ReturnT operator()( U& obj ) { u return static_cast<T*>(this)->operator()( obj ); d ro } }; in p this do template<typename Derived> n ’t struct Extendible { o se d template<typename T, typename ReturnT> ea ReturnT operator < ( ExtMethod<T, ReturnT>& extMethod ) { Pl }; } return extMethod( static_cast<Derived&>( *this ) );
Download now