关于模板化命名空间的WG21论文 [英] WG21 paper on templated namespaces
问题描述
大家好,
我一直在搜索论文列表:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/
我似乎记得有关模板命名空间的提议,例如:
模板< typename T>
命名空间X {
}
不幸的是我无法找到它。有谁知道我正在考虑或者我刚刚发明的那张纸的名称/号码?
问候
Andy Little
kwikius写道:[..]
我好像记住关于模板名称空间的提议,例如:
模板< typename T>
命名空间X {
}
[..]
该怎么办?
V
-
请在通过电子邮件回复时删除资金''A'
我没有回复最热门的回复,请不要问
kwikius写道:[..]
>
模板< typename T>
命名空间X {
}
[..]
它是什么SUP提出要做什么?
我有时会使用一个结构来分组东西以帮助源代码
易读性并节省输入:
模板< typename T>
结构长度{
typedef something_ugly< T,...> mm;
typedef somethingelse_ugly< T,...> m;
};
//声明something_ugly
长度< double> :: mm mylength;
结构的问题是你无法重新打开它,这将是一个理想的功能。也许我想添加英寸:
模板< typename T>
命名空间长度{
typedef something_else_again< T,.. > in;
}
长度< double> ::在mylength1;
我以为我见过ia有关此问题的论文,但现在无法找到。
有人知道我在说什么吗? (嗯,我真的想要这些家伙吗?
回答那个?... ;-)
问候
Andy Little
kwikius写道:Victor Bazarov写道:kwikius写道:[..]
我似乎记得有关模板名称空间的提案,例如:
模板< typename T>
名称空间X {
>}
[...]
它应该做什么?
我有时会用一个结构来分组东西以帮助源代码
易读性和节省打字:
模板< typename T>
结构长度{
typedef something_ugly< T,...> mm;
typedef somethingelse_ugly< T,...> m;
};
//声明一个something_ugly
长度< double> :: mm mylength;
结构的问题是你不能重新打开它,这将是一个理想的功能。也许我想添加英寸:
模板< typename T>
名称空间长度{
typedef something_else_again< T,...> in;
}
长度< double> :: in mylength1;
现在,告诉我,为什么不能你在原始结构中添加英寸?
命名空间有一定的用途。主要是为了防止名称冲突
并且为了清晰起见而不保存打字或分组。
我以为我曾经看过关于此的论文,但是不能现在找到它。有没有人知道我在说什么? (嗯,我真的希望这些家伙
回答这个问题吗?... ;-))
尝试询问''comp.std.c ++' ',但是。
V
-
请在通过电子邮件回复时删除资金''A'
我没有回复最热门的回复,请不要问
Hi all,
I have been searching through the list of papers at:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/
I seem to remember a proposal regarding templated namespaces e.g:
template <typename T>
namespace X{
}
Unfortunately I cant find it. Does anyone know the name/number of the
paper I''m thinking of or have I just invented it?
regards
Andy Little
kwikius wrote:[..]
I seem to remember a proposal regarding templated namespaces e.g:
template <typename T>
namespace X{
}
[..]
What is it supposed to do?
V
--
Please remove capital ''A''s when replying by e-mail
I do not respond to top-posted replies, please don''t ask
Victor Bazarov wrote:kwikius wrote:[..]
I seem to remember a proposal regarding templated namespaces e.g:
template <typename T>
namespace X{
}
[..]
What is it supposed to do?
I sometimes use a struct for grouping stuff to help in source code
legibility and to save typing:
template <typename T>
struct length{
typedef something_ugly<T,...> mm;
typedef somethingelse_ugly<T,...> m;
};
// declare a something_ugly
length<double>::mm mylength;
The problem with a struct is you cant reopen it, which would be a
desirable feature. Maybe I want to add inches:
template<typename T>
namespace length{
typedef something_else_again<T,...> in;
}
length<double>::in mylength1;
I thought I had seen i a paper about this, but cant find it now. Does
anyone know what I''m talking about? (hmm do I really want these guys to
answer that? ... ;-) )
regards
Andy Little
kwikius wrote:Victor Bazarov wrote:kwikius wrote:[..]
I seem to remember a proposal regarding templated namespaces e.g:
template <typename T>
namespace X{
}
[..]
What is it supposed to do?
I sometimes use a struct for grouping stuff to help in source code
legibility and to save typing:
template <typename T>
struct length{
typedef something_ugly<T,...> mm;
typedef somethingelse_ugly<T,...> m;
};
// declare a something_ugly
length<double>::mm mylength;
The problem with a struct is you cant reopen it, which would be a
desirable feature. Maybe I want to add inches:
template<typename T>
namespace length{
typedef something_else_again<T,...> in;
}
length<double>::in mylength1;
Now, tell me, why can''t you add inches to the original struct?
Namespaces have a certain purpose. Mostly it''s to prevent name collisions
and not save typing or grouping for legibility''s sake.
I thought I had seen i a paper about this, but cant find it now. Does
anyone know what I''m talking about? (hmm do I really want these guys
to answer that? ... ;-) )
Try asking in ''comp.std.c++'', though.
V
--
Please remove capital ''A''s when replying by e-mail
I do not respond to top-posted replies, please don''t ask
这篇关于关于模板化命名空间的WG21论文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!