Jon Stewart on Tue, 28 Sep 2004 01:41:48 -0500 (CDT)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[hosers-talk] Celebrity Deathmatch: Programmer v. Compiler


A long, long time ago, I wrote a complete hack of a function that did some 
ridiculous thing with c-style strings, something on the order of 
usefulness as reversing a string in place. It attempted to waste no 
cycles, and it pretty well succeeded (I think I even used a goto to save a 
statement). Josh said it should be featured on the television series "When 
Programmers Attack".

Now, many years later, I am still attacking. Unfortunately, my 
competition has more than kept pace with me. When I say:

  #define TEST_FIXTURE(testname, fixtureType) \
    void testname(fixtureType& fixture); \
    static AutoRegister UNIQUENAME(testname)(TestRunner::TestPtr(new 
      BoundTest(boost::lambda::bind(&BoundTest::RunFixture<fixtureType>, 
      _1, var(testname), _2), #testname))); \
    void testname(fixtureType& fixture)

you'd think the compiler would pretty much shut up and take it like the 
bitch it is. Instead, I get back:

       [cc] 
/usr/local/include/boost-1_31/boost/tuple/detail/tuple_basic.hpp: At
 global scope:
       [cc] 
/usr/local/include/boost-1_31/boost/tuple/detail/tuple_basic.hpp: In
 instantiation of `boost::tuples::element<0, boost::tuples::null_type>':
       [cc] 
/usr/local/include/boost-1_31/boost/tuple/detail/tuple_basic.hpp:137
:   instantiated from `boost::tuples::element<1, 
boost::tuples::tuple<std::list<
std::string, std::allocator<std::string> >&, boost::tuples::null_type, 
boost::tu
ples::null_type, boost::tuples::null_type, boost::tuples::null_type, 
boost::tupl
es::null_type, boost::tuples::null_type, boost::tuples::null_type, 
boost::tuples
::null_type, boost::tuples::null_type> >'
       [cc] 
/usr/local/include/boost-1_31/boost/lambda/detail/lambda_traits.hpp:
113:   instantiated from 
`boost::lambda::detail::tuple_element_as_reference<1, b
oost::tuples::tuple<std::list<std::string, std::allocator<std::string> >&, 
boost
::tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, 
boost::
tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, 
boost::tu
ples::null_type, boost::tuples::null_type, boost::tuples::null_type> >'
       [cc] 
/usr/local/include/boost-1_31/boost/lambda/detail/lambda_functors.hp
p:48:   instantiated from 
`boost::lambda::detail::get_element_or_null_type<1, bo
ost::tuples::tuple<std::list<std::string, std::allocator<std::string> >&, 
boost:
:tuples::null_type, boost::tuples::null_type, boost::tuples::null_type, 
boost::t
uples::null_type, boost::tuples::null_type, boost::tuples::null_type, 
boost::tup
les::null_type, boost::tuples::null_type, boost::tuples::null_type> >'
       [cc] 
/usr/local/include/boost-1_31/boost/lambda/detail/lambda_functors.hp
p:74:   instantiated from 
`boost::lambda::placeholder<2>::sig<boost::tuples::tup
le<std::list<std::string, std::allocator<std::string> >&, 
boost::tuples::null_ty
pe, boost::tuples::null_type, boost::tuples::null_type, 
boost::tuples::null_type
, boost::tuples::null_type, boost::tuples::null_type, 
boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type> >'


(Actually, I get back a lot more than this, but it's a good sample.)

Sigh.



Jon
-- 
Jon Stewart                                 Advanced Los Angeles C++
stew1@xxxxxxxxxxx                           http://www.alacpp.org
_______________________________________________
hosers-talk mailing list
hosers-talk@xxxxxxxxxxx
http://lists.ellipsis.cx/mailman/listinfo/hosers-talk