David Abrahams writes: David> "Ted Zlatanov" writes: >> On Tue, 19 Jul 2005, dave@boost-consulting.com wrote: >> >>> "Ted Zlatanov" writes: >>> >>>> Have you tried which-func-mode in GNU Emacs? >>> >>> What does it do other than try to display the current function name? >> >> Nothing. I'm sorry for posting before my coffee :) I know and use >> imenu, but somehow ended up writing about which-func-mode. David> I don't know what imenu is either. >> You can also look at the speedbar, which is nice (I've used it with >> Java). I don't know if the code it uses to recognize functions is >> different from imenu. >> >>> That particular feature is totally broken when it comes to C++. >> >> Really? Can you submit a bug to the Emacs team, if you have the time? David> I really don't have time to do that for a thing you just asked me David> to try and I had no other reason to use. However I'll give you a David> file that contains one class with inline member functions, where David> the only thing you ever see in the mode line is the class name. David> Voilą. David> // Copyright Daniel Wallin, David Abrahams 2005. Use, modification David> // and distribution is subject to the Boost Software License, David> // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at David> // http://www.boost.org/LICENSE_1_0.txt) David> #ifndef KEYWORD_050328_HPP define KEYWORD_050328_HPP David> #include include David> # include David> # include David> namespace boost { namespace parameter { David> // Instances of unique specializations of keyword<...> serve to David> // associate arguments with parameter names. For example: David> // David> // struct rate_; // parameter names struct skew_; namespace { David> // keyword rate; // keywords keyword skew; David> // } David> // David> // ... David> // David> // f(rate = 1, skew = 2.4); David> // David> template struct keyword : noncopyable { David> template typename aux::tag::type operator=(T& David> x) const { David> typedef typename aux::tag::type result; return David> result(x); David> } David> template aux::default_ David> operator|(Default& default_) const { David> return aux::default_(default_); David> } David> template aux::lazy_default David> operator||(Default& default_) const { David> return aux::lazy_default(default_); David> } David> #if !BOOST_WORKAROUND(BOOST_MSVC, <= 1200) // avoid partial David> #ordering bugs David> template typename aux::tag::type David> operator=(T const& x) const { David> typedef typename aux::tag::type result; David> return result(x); David> } David> #endif David> #if !BOOST_WORKAROUND(BOOST_MSVC, == 1200) // avoid partial David> #ordering bugs David> template aux::default_ David> operator|(const Default& default_) const David> #if BOOST_WORKAROUND(BOOST_MSVC, == 1300) David> volatile David> #endif David> { David> return aux::default_(default_); David> } David> template aux::lazy_default David> operator||(Default const& default_) const David> #if BOOST_WORKAROUND(BOOST_MSVC, == 1300) David> volatile David> #endif David> { David> return aux::lazy_default(default_); David> } David> #endif David> public: // Insurance against ODR violations David> // People will need to define these keywords in header files. David> // To prevent ODR violations, it's important that the keyword David> // used in every instantiation of a function template is the David> // same object. We provide a reference to a common instance of David> // each keyword object and prevent construction by users. David> static keyword& get() { David> static keyword result; return result; David> } David> private: David> keyword() {} David> }; David> // Reduces boilerplate required to declare and initialize keywords David> // without violating ODR. Declares a keyword tag type with the David> // given name in namespace tag_namespace, and declares and David> // initializes a David> // David> #define BOOST_PARAMETER_KEYWORD(tag_namespace,name) \ David> namespace tag_namespace { struct name; } \ David> ::boost::parameter::keyword& name \ = David> ::boost::parameter::keyword::get(); David> }} // namespace boost::parameter David> #endif // KEYWORD_050328_HPP David> -- Dave Abrahams Boost Consulting www.boost-consulting.com -- Danny Siu