home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 31,624 of 33,346   
   Francis Glassborow to Dave Abrahams   
   Re: Fun with compile-time binary literal   
   05 Nov 11 14:17:47   
   
   From: francis.glassborow@btinternet.com   
      
   On 05/11/2011 05:10, Dave Abrahams wrote:   
   > on Fri Nov 04 2011, "Gennaro Prota"  wrote:   
   >   
   >> On Thu, 03 Nov 2011 19:12:52 +0100, Daniel Krügler   
   >>   wrote:   
   >>   
   >>> Since gcc 4.7 has recently implemented user-defined literals, it is now   
   >>> finally possible to define a binary literal operator template that   
   >>> behaves very much like built-in literals.   
   >>   
   >> "Finally possible"? Apart from fun, what is the real-word need   
   >> for this stuff?   
   >   
   > Haven't you always wanted to write an entire lisp (or   
   > haskell or c++ or...) compiler as a template metaprogram so you can   
   > embed that language in your C++ code?  ;-)   
   >   
   > Everything we might do with template metaprogramming today can now have   
   > arbitrary syntax, without the limitations imposed by C++, if you're   
   > willing to write the programs inside user-defined literals.   
   >   
      
      
   Which reminds me of the article I wrote in the late 1990s about a   
   language_cast<> :) It was my column for the the April issue of .EXE   
   Magazine (a magazine for UK developers, that is, regrettably defunct --   
   it stopped publication just as it published my 100th column :) that year.   
      
   Now writing an entire C++ compiler as a metaprogram looks like an   
   interesting task for running on hardware circa 2020. I guess EDG should   
   be up to it:)   
      
      
   --   
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca