我是Emacs的新手,而且
我有以下代码作为示例。
我已经安装了
GNU Emacs 23.1.1 (i386-mingw-nt6.1.7600)
安装
cedet-1.0pre7.tar.gz.
安装
ELPA
和
company
.
您可以在底部找到我的简单emacs配置。
问题是,当我打字的时候
Q〔0〕
在里面
主体()
新闻界
.
(点),我看到向量的37个成员,不是
人
虽然
第一姓
和
姓氏
是应该的。功能中预期的完工工程
绿色()
但这与向量无关。
我的问题是,如何完成向量元素的代码完成?
#include <iostream>
#include <vector>
using namespace std;
class Person
{
public:
string first_name;
string last_name;
};
void greet(Person a_person)
{
// a_person.first_name is completed as expected!
cout << a_person.first_name << "|";
cout << a_person.last_name << endl;
};
int main()
{
vector<Person> q(2);
Person guy1;
guy1.first_name = "foo";
guy1.last_name = "bar";
Person guy2;
guy2.first_name = "stack";
guy2.last_name = "overflow";
q[0] = guy1;
q[1] = guy2;
greet(guy1);
greet(guy2);
// cout q[0]. I want to see first_name or last_name here!
}
我的Emacs配置:
;;; This was installed by package-install.el.
;;; This provides support for the package system and
;;; interfacing with ELPA, the package archive.
;;; Move this code earlier if you want to reference
;;; packages in your .emacs.
(when
(load
(expand-file-name "~/.emacs.d/elpa/package.el"))
(package-initialize))
(load-file "~/.emacs.d/cedet/common/cedet.el")
(semantic-load-enable-excessive-code-helpers)
(require 'semantic-ia)
(global-srecode-minor-mode 1)
(semantic-add-system-include "/gcc/include/c++/4.4.2" 'c++-mode)
(semantic-add-system-include "/gcc/i386-pc-mingw32/include" 'c++-mode)
(semantic-add-system-include "/gcc/include" 'c++-mode)
(defun my-semantic-hook ()
(imenu-add-to-menubar "TAGS"))
(add-hook 'semantic-init-hooks 'my-semantic-hook)