filmov
tv
CppCon 2018: Stephen Dewhurst “Talking to Typelists”

Показать описание
—
—
Talking to Typelists
Type sequences implemented with variadic templates have largely supplanted the traditional use of typelists in new C++ code. However, we have nearly two decade’s worth of complex, debugged, and useful legacy typelist code that we’d like to leverage for use with type sequences without having to rewrite them.
Additionally, modern C++ metaprogramming makes extensive use of index sequences as well as type sequences. Many index sequence meta‐algorithms are logically similar to corresponding meta‐algorithms on typelists (and type sequences). Wouldn’t it be convenient to simply and automatically convert a typelist meta‐algorithm into a functionally‐similar index sequence meta‐algorithm?
To be concrete, if we have Sort meta‐algorithm that sorts a typelist with a compile‐time comparator that compares types, wouldn’t it be nice to generate automatically a sort_is meta‐algorithm that sorts an index sequence with a compile‐time comparator that compares indexes? You bet it would!
In this presentation, attendees will learn how useful alias templates are both for syntactic cleanup and to implement advanced template metaprogramming techniques, and we'll see that there really is not a lot of difference among techniques for the manipulation of collections of types, values, and templates at compile time.
—
Stephen Dewhurst
Semantics Consulting, Inc.
President
Steve Dewhurst is the co-founder and president of Semantics Consulting, Inc. Steve is the author of numerous technical articles on C++ programming techniques and compiler design, is the author of the critically acclaimed books C++ Common Knowledge and C++ Gotchas, and is the co-author of Programming in C++. He is a frequent speaker at industry conferences, where his presentations are consistently among the most popular and highest rated. He is also a member of the advisory board for The C++ Source, was programming track chair for the Embedded Systems Conference (ESC), and was a visiting scientist at the Software Engineering Institute (SEI) at Carnegie Mellon University. Steve has mentored and consulted with C++ projects ranging in size from 1 to over 100 developers, in areas ranging from compiler design to embedded telecommunications to ecommerce to derivative securities trading. As a Member of Technical Staff in the UNIX Development Laboratory at AT&T Bell Laboratories, Steve worked with Bjarne Stroustrup, the designer and first implementer of C++, on the first public release of the language and cfront C++ compiler, then served as the lead designer and implementer of the first non-cfront C++ compiler. As a compiler architect at Glockenspiel, Ltd., he designed and implemented a second C++ compiler. Steve was a contributing editor for The C/C++ User's Journal, a principal lecturer at The C++ Seminar, has served as a principal on the ANSI/ISO C++ standardization committee, was the C++ training series adviser for Technology Exchange Company (Addison-Wesley), was a member of the editorial board of and columnist for C++ Report, co-founder and member of the editorial board of The C++ Journal, and a Visiting Professor of Computer Science at Jackson State University. He has also written C, COBOL, and Pascal compilers, was a principal on the ANSI/IEEE Pascal Standardization Committee, and a reviewer for ACM Computing Reviews. Semantics Consulting, Inc. is located in the small New England town of Carver, Massachusetts. Like all small New England towns, Carver has a tradition of citizen involvement, and over the years Steve has been astonished to find himself harvesting cranberries, coaching the high school wrestling team, and serving on the town water commission, finance committee, and website committee.
—
*-----*
*-----*
—
Talking to Typelists
Type sequences implemented with variadic templates have largely supplanted the traditional use of typelists in new C++ code. However, we have nearly two decade’s worth of complex, debugged, and useful legacy typelist code that we’d like to leverage for use with type sequences without having to rewrite them.
Additionally, modern C++ metaprogramming makes extensive use of index sequences as well as type sequences. Many index sequence meta‐algorithms are logically similar to corresponding meta‐algorithms on typelists (and type sequences). Wouldn’t it be convenient to simply and automatically convert a typelist meta‐algorithm into a functionally‐similar index sequence meta‐algorithm?
To be concrete, if we have Sort meta‐algorithm that sorts a typelist with a compile‐time comparator that compares types, wouldn’t it be nice to generate automatically a sort_is meta‐algorithm that sorts an index sequence with a compile‐time comparator that compares indexes? You bet it would!
In this presentation, attendees will learn how useful alias templates are both for syntactic cleanup and to implement advanced template metaprogramming techniques, and we'll see that there really is not a lot of difference among techniques for the manipulation of collections of types, values, and templates at compile time.
—
Stephen Dewhurst
Semantics Consulting, Inc.
President
Steve Dewhurst is the co-founder and president of Semantics Consulting, Inc. Steve is the author of numerous technical articles on C++ programming techniques and compiler design, is the author of the critically acclaimed books C++ Common Knowledge and C++ Gotchas, and is the co-author of Programming in C++. He is a frequent speaker at industry conferences, where his presentations are consistently among the most popular and highest rated. He is also a member of the advisory board for The C++ Source, was programming track chair for the Embedded Systems Conference (ESC), and was a visiting scientist at the Software Engineering Institute (SEI) at Carnegie Mellon University. Steve has mentored and consulted with C++ projects ranging in size from 1 to over 100 developers, in areas ranging from compiler design to embedded telecommunications to ecommerce to derivative securities trading. As a Member of Technical Staff in the UNIX Development Laboratory at AT&T Bell Laboratories, Steve worked with Bjarne Stroustrup, the designer and first implementer of C++, on the first public release of the language and cfront C++ compiler, then served as the lead designer and implementer of the first non-cfront C++ compiler. As a compiler architect at Glockenspiel, Ltd., he designed and implemented a second C++ compiler. Steve was a contributing editor for The C/C++ User's Journal, a principal lecturer at The C++ Seminar, has served as a principal on the ANSI/ISO C++ standardization committee, was the C++ training series adviser for Technology Exchange Company (Addison-Wesley), was a member of the editorial board of and columnist for C++ Report, co-founder and member of the editorial board of The C++ Journal, and a Visiting Professor of Computer Science at Jackson State University. He has also written C, COBOL, and Pascal compilers, was a principal on the ANSI/IEEE Pascal Standardization Committee, and a reviewer for ACM Computing Reviews. Semantics Consulting, Inc. is located in the small New England town of Carver, Massachusetts. Like all small New England towns, Carver has a tradition of citizen involvement, and over the years Steve has been astonished to find himself harvesting cranberries, coaching the high school wrestling team, and serving on the town water commission, finance committee, and website committee.
—
*-----*
*-----*
Комментарии