alias

Can an identity alias template be a forwarding reference?

余生颓废 提交于 2019-11-30 17:23:01
Consider the following snippet below: template <class T> using identity = T; template <class T> void foo(identity<T>&&) {} int main() { int i{}; foo(i); } i is an lvalue, hence if foo declares a forwarding reference parameter, it should compile. However, if identity<T>&& is turned to be int&& , it should raise an error instead. The code compiles in GCC 6.0.0 ( demo ). The code fails to compile in Clang 3.7.0 ( demo ) with error message: error: no known conversion from 'int' to 'identity<int> &&' (aka 'int &&') for 1st argument Which one is right? bogdan Consider this code: template<class T>

Can an identity alias template be a forwarding reference?

核能气质少年 提交于 2019-11-30 16:34:26
问题 Consider the following snippet below: template <class T> using identity = T; template <class T> void foo(identity<T>&&) {} int main() { int i{}; foo(i); } i is an lvalue, hence if foo declares a forwarding reference parameter, it should compile. However, if identity<T>&& is turned to be int&& , it should raise an error instead. The code compiles in GCC 6.0.0 (demo). The code fails to compile in Clang 3.7.0 (demo) with error message: error: no known conversion from 'int' to 'identity<int> &&'

How to properly configure alias directive in nginx?

醉酒当歌 提交于 2019-11-30 13:58:55
问题 I have been trying to configure multiple webapp on my nginx webserver but I can't get working one Laravel app that requires $document_root set to laravel public folder. I am currently trying to configure it using alias directive but for an obscure reason this doesn't work. Here is what I am trying to do. # Default server configuration # server { listen 80; # SSL configuration # listen 443 ssl; error_log /var/log/nginx/error.log warn; ssl_certificate /etc/nginx/ssl/server.crt; ssl_certificate

ES 基本操作

不羁岁月 提交于 2019-11-30 12:43:12
0.查看集群是否健康 GET /_cluster/health 1.查询所有索引 GET /_cat/indices?v 2.查询单个索引的映射 GET /index_trans_detail/_mapping 3.删除index DELETE /index_trans_detail,index_two 4. 添加字段映射 PUT /index_trans_detail/_mapping/type_trans_detail { "properties": { "tags":{ "type": "text" } } } 5. 索引的别名 5.1 创建索引的别名 PUT /index_trans_detail/_alias/index_trans_detail_alias 5.2 查询索引的别名 GET /index_trans_detail/_alias/* 5.3 查询别名指向哪一个索引 GET /*/_alias/index_trans_detail_alias 5.4 删除别名 DELETE /index_trans_detail/_alias/index_trans_detail_alias 6. 添加一个索引(通过mapping) PUT /people { "settings": { "number_of_shards": 3, "number_of_replicas":

Renaming namespaces

你说的曾经没有我的故事 提交于 2019-11-30 10:53:02
I've been doing C++ for a long time now but I just faced a question this morning to which I couldn't give an answer: "Is it possible to create aliases for namespaces in C++ ?" Let me give an example. Let's say I had the following header: namespace old { class SomeClass {}; } Which, for unspecified reasons had to become: namespace _new { namespace nested { class SomeClass {}; // SomeClass hasn't changed } } Now if I have an old code base which refers to SomeClass , I can quickly (and dirtily) "fix" the change by adding: namespace old { typedef _new::nested::SomeClass SomeClass; } But is there a

In C#, why is “int” an alias for System.Int32?

一世执手 提交于 2019-11-30 10:44:37
Since C# supports Int8 , Int16 , Int32 and Int64 , why did the designers of the language choose to define int as an alias for Int32 instead of allowing it to vary depending on what the native architecture considers to be a word ? I have not had any specific need for int to behave differently than the way it does, I am only asking out of pure encyclopedic interest. I would think that a 64-bit RISC architecture could conceivably exist which would most efficiently support only 64-bit quantities, and in which manipulations of 32-bit quantities would require extra operations. Such an architecture

Can Aliasing Problems be Avoided with const Variables

百般思念 提交于 2019-11-30 09:43:32
My company uses a messaging server which gets a message into a const char* and then casts it to the message type. I've become concerned about this after asking this question . I'm not aware of any bad behavior in the messaging server. Is it possible that const variables do not incur aliasing problems? For example say that foo is defined in MessageServer in one of these ways: As a parameter: void MessageServer(const char* foo) Or as const variable at the top of MessageServer : const char* foo = PopMessage(); Now MessageServer is a huge function, but it never assigns anything to foo , however at

How to properly configure alias directive in nginx?

旧街凉风 提交于 2019-11-30 09:04:29
I have been trying to configure multiple webapp on my nginx webserver but I can't get working one Laravel app that requires $document_root set to laravel public folder. I am currently trying to configure it using alias directive but for an obscure reason this doesn't work. Here is what I am trying to do. # Default server configuration # server { listen 80; # SSL configuration # listen 443 ssl; error_log /var/log/nginx/error.log warn; ssl_certificate /etc/nginx/ssl/server.crt; ssl_certificate_key /etc/nginx/ssl/server.key; set $root_path '/var/www/html'; root $root_path; # Add index.php to the

How to use Mac Finder to list all aliases in a folder

柔情痞子 提交于 2019-11-30 07:32:57
问题 I downloaded a repository from Bitbucket.org as a zip file and unzipped it using iZip to my Mac. Xcode found many compile errors because the zip or unzip did not preserve aliases properly. So I used hg to clone the repo, the aliases were preserved, and the Xcode compile was then clean. I would like to find all the aliases in my folder and replace them by their targets so future zips will work. I've done a lot of searching and can't find anything that says how find them either with the Mac

Lost keystore alias but have file and password used for alias

冷暖自知 提交于 2019-11-30 06:33:42
recently I added a new alias to my keystore to sign my app. Now I lost the new generated file with the alias, but remember the password and the alias name and have an older copy the file. Is there a way to recreate the alias using this things? mah You can list the contents of your keystore with the command: keytool -list -keystore <name of keystore file> To do this, you will need to provide the keystore password (not the alias password). This will tell you the aliases in the file, which are self-contained, allowing you to sign. If you wish, you could also extract keys using other options /