[fusion] Quick start in doc - Something to modify ?

Hi Boosters, I've been reading the Boost.Fusion documentation and I saw an "error" on the Quick Start page : http://spirit.sourceforge.net/dl_more/fusion_v2/libs/fusion/doc/html/fusion/... The given code is : #include <boost/fusion/sequence.hpp> #include <boost/fusion/include/sequence.hpp> // ... vector <http://spirit.sourceforge.net/dl_more/fusion_v2/libs/fusion/doc/html/fusion/container/vector.html><int, char, std::string> stuff(1, 'x', "howdy"); int i = at_c <http://spirit.sourceforge.net/dl_more/fusion_v2/libs/fusion/doc/html/fusion/sequence/intrinsic/functions/at_c.html><0>(stuff); char ch = at_c <http://spirit.sourceforge.net/dl_more/fusion_v2/libs/fusion/doc/html/fusion/sequence/intrinsic/functions/at_c.html><1>(stuff); std::string s = at_c <http://spirit.sourceforge.net/dl_more/fusion_v2/libs/fusion/doc/html/fusion/sequence/intrinsic/functions/at_c.html><2>(stuff); But this way we never get any vector.hpp included. (however I'm on the svn version... maybe on 1.36 one of the sequence.hpp includes vector... but I think it is rather the one in the container dir) And I think such an error makes people let Fusion down, so here is a "minimal" code that would have a much better effect, IMO, on fusion's doc readers. #include <boost/fusion/sequence.hpp> // for boost::fusion::at_c #include <boost/fusion/include/vector.hpp> // for boost::fusion::vector #include <iostream> #include <string> using namespace boost::fusion; int main() { vector<int, char, std::string> stuff(1, 'x', "howdy"); int i = at_c<0>(stuff); char ch = at_c<1>(stuff); std::string s = at_c<2>(stuff); std::cout << "(" << i << "," << ch << "," << s << ")" << std::endl; return 0; } This way, they'd just have to copy, paste, compile & launch to see Fusion in action, which would make them read the rest of the doc more happily. Hope it helps. -- Alp Mestan --- http://blog.mestan.fr/

Alp Mestan wrote:
Hi Boosters,
I've been reading the Boost.Fusion documentation and I saw an "error" on the Quick Start page : http://spirit.sourceforge.net/dl_more/fusion_v2/libs/fusion/doc/html/fusion/...
The given code is :
[snip corrected code]
This way, they'd just have to copy, paste, compile & launch to see Fusion in action, which would make them read the rest of the doc more happily.
Hope it helps.
Thanks for spotting this. It would be good to have all the code in the docs be testable by making use of Quickbook's import code mechanism where all the code can be part of the tests. Would you be interested in doing this too? Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net

Hi, Yes I would be... Just have to study & learn how Quickbook works. Maybe this evening I'll reserve some time to this. I'll keep you updated. On Thu, Oct 16, 2008 at 4:04 AM, Joel de Guzman <joel@boost-consulting.com>wrote:
Alp Mestan wrote:
Hi Boosters,
I've been reading the Boost.Fusion documentation and I saw an "error" on the Quick Start page :
http://spirit.sourceforge.net/dl_more/fusion_v2/libs/fusion/doc/html/fusion/...
The given code is :
[snip corrected code]
This way, they'd just have to copy, paste, compile & launch to see Fusion in action, which would make them read the rest of the doc more happily.
Hope it helps.
Thanks for spotting this. It would be good to have all the code in the docs be testable by making use of Quickbook's import code mechanism where all the code can be part of the tests. Would you be interested in doing this too?
Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-- Alp Mestan --- http://blog.mestan.fr/ --- http://alp.developpez.com/ --- In charge of the Qt, Algorithms and Artificial Intelligence sections on Developpez
participants (2)
-
Alp Mestan
-
Joel de Guzman