Gnus development mailing list
 help / color / mirror / Atom feed
From: David Abrahams <dave@boost-consulting.com>
Subject: Re: func-menu
Date: Tue, 19 Jul 2005 11:41:14 -0400	[thread overview]
Message-ID: <ubr4ypzvp.fsf@boost-consulting.com> (raw)
In-Reply-To: <4n7jfmu8kb.fsf@lifelogs.com> (Ted Zlatanov's message of "19 Jul 2005 11:20:04 -0400")

[-- Attachment #1: Type: text/plain, Size: 1052 bytes --]

"Ted Zlatanov" <tzz@lifelogs.com> writes:

> On Tue, 19 Jul 2005, dave@boost-consulting.com wrote:
>
>> "Ted Zlatanov" <tzz@lifelogs.com> 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.

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?

I really don't have time to do that for a thing you just asked me
to try and I had no other reason to use.  However I'll give you a file
that contains one class with inline member functions, where the only
thing you ever see in the mode line is the class name.  Voilà.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: keyword.hpp --]
[-- Type: text/x-c++, Size: 3349 bytes --]

// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
// distribution is subject to the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#ifndef KEYWORD_050328_HPP
#define KEYWORD_050328_HPP

#include <boost/parameter/aux_/unwrap_cv_reference.hpp>
#include <boost/parameter/aux_/tag.hpp>
#include <boost/parameter/aux_/default.hpp>
#include <boost/noncopyable.hpp>

namespace boost { namespace parameter {

// Instances of unique specializations of keyword<...> serve to
// associate arguments with parameter names.  For example:
//
//    struct rate_;           // parameter names
//    struct skew_;
//    namespace
//    {
//      keyword<rate_> rate;  // keywords
//      keyword<skew_> skew;
//    }
//
//    ...
//
//    f(rate = 1, skew = 2.4);
//
template <class Tag>
struct keyword : noncopyable
{
    template <class T>
    typename aux::tag<Tag, T>::type
    operator=(T& x) const
    {
        typedef typename aux::tag<Tag, T>::type result;
        return result(x);
    }

    template <class Default>
    aux::default_<Tag, Default>
    operator|(Default& default_) const
    {
        return aux::default_<Tag, Default>(default_);
    }

    template <class Default>
    aux::lazy_default<Tag, Default>
    operator||(Default& default_) const
    {
        return aux::lazy_default<Tag, Default>(default_);
    }

#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1200)  // avoid partial ordering bugs
    template <class T>
    typename aux::tag<Tag, T const>::type
    operator=(T const& x) const
    {
        typedef typename aux::tag<Tag, T const>::type result;
        return result(x);
    }
#endif 

#if !BOOST_WORKAROUND(BOOST_MSVC, == 1200)  // avoid partial ordering bugs
    template <class Default>
    aux::default_<Tag, const Default>
    operator|(const Default& default_) const
#if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
        volatile
#endif 
    {
        return aux::default_<Tag, const Default>(default_);
    }

    template <class Default>
    aux::lazy_default<Tag, Default>
    operator||(Default const& default_) const
#if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
        volatile
#endif 
    {
        return aux::lazy_default<Tag, Default>(default_);
    }
#endif

 public: // Insurance against ODR violations
    
    // People will need to define these keywords in header files.  To
    // prevent ODR violations, it's important that the keyword used in
    // every instantiation of a function template is the same object.
    // We provide a reference to a common instance of each keyword
    // object and prevent construction by users.
    
    static keyword<Tag>& get()
    {
        static keyword<Tag> result;
        return result;
    }
    
 private:
    keyword() {}
};

// Reduces boilerplate required to declare and initialize keywords
// without violating ODR.  Declares a keyword tag type with the given
// name in namespace tag_namespace, and declares and initializes a 
// 
#define BOOST_PARAMETER_KEYWORD(tag_namespace,name)             \
   namespace tag_namespace { struct name; }                     \
   ::boost::parameter::keyword<tag_namespace::name>& name       \
   = ::boost::parameter::keyword<tag_namespace::name>::get();


}} // namespace boost::parameter

#endif // KEYWORD_050328_HPP


[-- Attachment #3: Type: text/plain, Size: 61 bytes --]


-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

  reply	other threads:[~2005-07-19 15:41 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-03 13:30 Asynchronous Gnus? David Abrahams
2005-06-03 20:37 ` Gnus with Exim (was: Asynchronous Gnus?) David Abrahams
2005-06-03 22:28   ` Gnus with Exim Steven E. Harris
2005-06-04 13:47     ` David Abrahams
2005-06-04 15:29       ` Steven E. Harris
2005-06-06  2:05         ` David Abrahams
2005-06-06 17:04           ` Steven E. Harris
2005-06-06 18:31             ` David Abrahams
2005-06-06 19:59               ` Steven E. Harris
2005-06-06 20:43                 ` David Abrahams
2005-06-06 22:44                   ` Steven E. Harris
2005-06-06 23:08                     ` David Abrahams
2005-06-06 23:47                       ` Steven E. Harris
2005-06-07  1:36                         ` David Abrahams
2005-06-08 18:14                           ` Steven E. Harris
2005-06-08 19:45                             ` David Abrahams
2005-06-08 20:14                               ` Steven E. Harris
2005-06-08 20:48                                 ` David Abrahams
2005-06-08 21:20                                   ` Steven E. Harris
2005-06-23 18:49                                     ` David Abrahams
2005-06-24 17:14                                       ` Steven E. Harris
2005-06-24 18:09                                         ` David Abrahams
2005-06-25 15:33                                           ` Steven E. Harris
2005-07-19 11:05                                     ` func-menu David Abrahams
2005-07-19 14:01                                       ` func-menu J. David Boyd
2005-07-19 14:21                                       ` func-menu Ted Zlatanov
2005-07-19 14:35                                         ` func-menu David Abrahams
2005-07-19 15:20                                           ` func-menu Ted Zlatanov
2005-07-19 15:41                                             ` David Abrahams [this message]
2005-07-20  1:03                                               ` func-menu Danny Siu
2005-07-22 14:55                                                 ` func-menu David Abrahams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ubr4ypzvp.fsf@boost-consulting.com \
    --to=dave@boost-consulting.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).