clang error while compiling template I am trying to touch C++17 features and I have selected clang.  Here is simplified example of my code that could not be compiled via clang:  #include &lt;iostream&gt; #include &lt;limits&gt;  template&lt;     typename T,     template&lt;typename T_&gt; typename Final&gt; class Base { public:     decltype(auto) Foo() const noexcept     {         using TFinal = Final&lt;T&gt;;         auto&amp; _this = static_cast&lt;const TFinal&amp;&gt;(*this);         return _this.Bar&lt;true&gt;();     } };  template&lt;typename T&gt; class Derived :     public Base&lt;T, ::Derived&gt; { public:     template&lt;bool min&gt;     T Bar() const noexcept     {         return min ?             std::numeric_limits&lt;T&gt;::lowest() :             std::numeric_limits&lt;T&gt;::max();     } };  int main() {     Derived&lt;int&gt; instance;     auto result = instance.Foo();     std::cout &lt;&lt; result &lt;&lt; std::endl;     return 0; }   It fails here:  return _this.Bar&lt;true&gt;();   and error message is:  main.cpp:14:32: error: expected expression         return _this.Bar&lt;true&gt;();                                ^ main.cpp:35:10: error: variable has incomplete type 'void'     auto result = instance.Foo();          ^       Here is how I am compiling it:  clang++-5.0 main.cpp -std=c++17   Some additional info. Visual Studio 17 with latest language version can eat this. When bar function is not template, everything is ok...  Any suggestions what is wrong here?
Where and why do I have to put the "template" and "typename" keywords? In templates, where and why do I have to put typename and template on dependent names? What exactly are dependent names anyway?    I have the following code:  template &lt;typename T, typename Tail&gt; // Tail will be a UnionNode too. struct UnionNode : public Tail {     // ...     template&lt;typename U&gt; struct inUnion {         // Q: where to add typename/template here?         typedef Tail::inUnion&lt;U&gt; dummy;      };     template&lt; &gt; struct inUnion&lt;T&gt; {     }; }; template &lt;typename T&gt; // For the last node Tn. struct UnionNode&lt;T, void&gt; {     // ...     template&lt;typename U&gt; struct inUnion {         char fail[ -2 + (sizeof(U)%2) ]; // Cannot be instantiated for any U     };     template&lt; &gt; struct inUnion&lt;T&gt; {     }; };   The problem I have is in the typedef Tail::inUnion&lt;U&gt; dummy line. I'm fairly certain that inUnion is a dependent name, and VC++ is quite right in choking on it. I also know that I should be able to add template somewhere to tell the compiler that inUnion is a template-id. But where exactly? And should it then assume that inUnion is a class template, i.e. inUnion&lt;U&gt; names a type and not a function?
Locally bounded additive function is linear Let $T:\mathbb{R}^k\to\mathbb{R}^m$ is additive, i.e. $T(X_1+X_2)=T(X_1)+T(X_2)$. $T$ is locally bounded. Prove that $T$ is a linear transformation.  I know there is a relation between boundedness, convexity and scalar multiplicity. But not sure where to start or how to tie things together. Force a program to run *without* administrator privileges or UAC? Is there any way that I can force a program that normally requires administrator privileges (via UAC) to run without them? (ie: no UAC prompt and no system-wide access.)  Added: Without modifying the executable itself.    In spite of James's answer, I have found a few ways that it can almost be done:   By modifying the executable I can remove the trustInfo entry from the manifest (or the manifest entirely, so I can use an external one), allowing the program to start without UAC. Unfortunately this modifies the executable, so it exits shortly after due to an internal checksum test. By using Process Explorer I can launch it as a Limited User. However this seems to limit it significantly more than I would like (it runs like Protected Mode IE and so can access significantly less than what my standard un-elevated user can). Injecting beans into a class outside the Spring managed context I'm an end-user of one of my company's products. It is not very suitable for integration into Spring, however I am able to get a handle on the context and retrieve the required bean by name.  However, I would still like to know if it was possible to inject a bean into this class, even though the class is not managed by Spring itself.  Clarification: The same application which is managing the lifecycle of some class MyClass, is also managing the lifecycle of the Spring context. Spring does not have any knowledge of the instance of MyClass, and I would like to some how provide the instance to the context, but cannot create the instance in the context itself. Can RUBIK's cube be solved using group theory? If yes, how can we use it to solve a $2\times2$ Rubiks Cube? Privacy/Security concers for setting up business email using Gmail app on Nexus devices I need to set up my business email*(non gmail email)* on the mobile devices (Nexus 5 and Nexus7). The business has its own private mail server. The way I can do it is by using Gmail app on these devices. The question I have is does Gmail app on the mobile devices store the IMAP emails(non gmail emails) on the gmail servers? Or Gmail app is just a client and does not bother storing the IMAP emails(non gmail emails) on its servers that are not gmail emails? Thanks for the insight... Maximum power transfer and Thevenin I am trying to find the thevenin resistance value and the Vth for maximum power transfer. I have tried to find Rth by calculating R3 and R2 as parallel resistance and same for R4 and R5 and then adding them with R1 but I am not sure if I have done it the right way. For Vth I have tried using KVL but I think I have calculated wrong current values using current divider rule. I calculated the total current by diving V1 and R1. I hope someone can help. I have attached the picture of the circuit. Repeating "to" and "will" in enumerations of verbs Should I use the second "will" in constructions like this one: "it will definitely help you and will make the text more readable"  And should I write "to" before every infinitive in enumeration, or only before the first one, e.g. "it helps to develop and test" or "it helps to develop and to test"? Could this example be influenced by the fact that "help" can go with to-invinitive and bare infinitive, and with other verbs the rule would be different? I would like to ask for some simple examples showing the uses of &lt;div&gt; and &lt;span&gt;.   I've seen them both used to mark a section of a page with an id or class, but I'm interested in knowing if there are times when one is preferred over the other. Suppose $f$ is an isometric (i.e., distance preserving) function on $\mathbb{E}^2$ such that $f(0,0) = (0,0)$.  Then I want to show that $f$ is necessarily linear.  Now $f$ is linear iff $f$ is both additive and homogenous.  The following is an attempted proof for the homogeneity of f (missing the last step); still more, I have no idea how to argue for the additivity of $f$.  Any ideas?  Let $x \in \mathbb{E}^2$ and $\alpha \in \mathbb{R}$   We know that $\forall x \in \mathbb{E}^2$, $\Vert x - 0 \Vert = \Vert f(x) - f(0)\Vert = \Vert f(x) - 0 \Vert$ so that $\Vert x\Vert = \Vert f(x)\Vert$.  From this we immediately have the following facts:  $\Vert x \Vert = \Vert f(x) \Vert$  $\Vert \alpha x \Vert = \Vert f(\alpha x) \Vert$  We can then argue that since $\Vert \alpha x\Vert = |\alpha| \Vert x \Vert = |\alpha| \Vert f(x) \Vert = \Vert \alpha f(x) \Vert$, we also have that $\Vert f(\alpha x) \Vert = \Vert \alpha f(x)\Vert$.  Finally, we have that  $\Vert \alpha x - x \Vert = \Vert \alpha f(x) - f(x) \Vert$   iff $ \Vert (\alpha - 1)x \Vert = \Vert (\alpha - 1) f(x) \Vert$   iff $|\alpha - 1| \Vert x \Vert = |\alpha - 1| \Vert f(x) \Vert$  Since the last of these statements is in fact true, we now have $\Vert \alpha x - x \Vert = \Vert \alpha f(x) - f(x) \Vert$ as desired.  Now at this point it seems like I have all of the facts required to assert that $f(\alpha x) = \alpha f(x)$, but I can't figure out how to formally state why without illegally appealing to visual intuition.  Any ideas? How can I evaluate $\int_{-\infty}^{\infty} e^{-x^2} dx$ without using polar coordinates Why is 4 not an instance of Number? It is impossible for $(x-1)^2+x^2+(x+1)^2$ to be a perfect square Prove that it is impossible for three consecutive squares to sum to another perfect square. I have tried for the three numbers $x-1$, $x$, and $x+1$. rsync two existing directories copying everything I have two file servers in two locations. Currently both have the same data, which generally is unmodified (used for read only access).When the second server was set up (the one I'm sshing to) the data was copied over LAN and has since been moved geographically.  I'm trying to use rsync for the first time on the required directories. An example command;  sudo rsync -avz --ignore-existing -P --dry-run /media/Storage/OSs/ user@mydomain:/mnt/Storage/OSs/   I've tried using -c -t -u (Additionally went on the remote server and updated the timestamps to today) also but every time I execute a dry run it wants to copy everything!  Additionally the user is the same for both machines with the same UID.  *Edit  After playing around a bit more, I've found that rsync does not like the whitespace in the subdirectory names; For instance if I use ' to escape local shell &amp; \ to escape remote shell     sudo rsync -avz --ignore-existing -P '/media/Storage/OSs/Windows/Windows server 2011/' 'user@mydomain:/mnt/Storage/OSs/Windows/Windows\ server\ 2011/'   Then all is well, my theory is then that rsync does not like the subdirectories with whitespaces. I have thousands of subdirectories; the only solution I can think of is to write a small python/shell script to run each sub directory separately but is undesirable. How do I use reflection to invoke a private method? There are a group of private methods in my class, and I need to call one dynamically based on an input value. Both the invoking code and the target methods are in the same instance. The code looks like this:  MethodInfo dynMethod = this.GetType().GetMethod("Draw_" + itemType); dynMethod.Invoke(this, new object[] { methodParams });   In this case, GetMethod() will not return private methods. What BindingFlags do I need to supply to GetMethod() so that it can locate private methods? I am tired of always trying to guess, if I should escape special characters like '()[]{}|' etc. when using many implementations of regexps.  It is different with, for example, Python, sed, grep, awk, Perl, rename, Apache, find and so on. Is there any rule set which tells when I should, and when I should not, escape special characters? Does it depend on the regexp type, like PCRE, POSIX or extended regexps? A finite sum involving the binomial coefficients and the harmonic numbers Wikipedia has a proof of the identity $$ H_{n} =\sum_{k=1}^{n} (-1)^{k-1} \binom{n}{k} \frac{1}{k}$$    Curiously, there is also the identity  $$ \frac{1}{n} = \sum_{k=1}^{n} (-1)^{k-1} \binom{n}{k} H_{k} $$  Can the second identity be derived from the first one? Does anyone know the name of travel posters from the 1930s? Should smilies be turned into images in questions and answers? A lot of mention has been made of the seriousness of Stack Overflow (and presumably Server Fault). Would it be a good idea to turn  :-) into actual images as per  in questions and answers? How to *disable* automatic reboots in Windows 10? Selecting features within Polygon from another layer using QGIS? I'm using QGIS 1.8 with a PostGIS database and I have three PostGIS-layers in QGIS a lines layer, a points layer and a polygon layer.  What I'm trying to do is to select a polygon in the polygon layer and mark all points within this polygon.   For me the only way to do this is to use the button "Select by Polygon" but in this way, I cannot use an existing polygon for selection.