Calling member template function within non-member template function I've got this example which compiles under MSVC2015 but not Clang. I'm programming code that I want to run everywhere. I get an "error : expected expression" message. I've searched SO but I can't seem to find this exact same problem.  template&lt;int T&gt; class SomeClass { public:     template&lt;int S&gt;     int Foo()     {         return S;     } };  template&lt;int X&gt; void Fun() {     SomeClass&lt;X&gt; c;     c.Foo&lt;0&gt;(); }  int main() {     Fun&lt;0&gt;(); }
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?
What's the difference between "either" and "neither"? How to configure @SkipValidation by XML configuration in Struts 2 It's my understanding that the phrase "Winter is Coming" is the motto of the Stark house, when the story first reaches the wall it's implied that the winter is not a periodic season like it is in our world.  Does the winter refer to a particularly severe season or does a winter only occur every few years? How to clone/copy all file/directory attributes onto different file/directory? I want to copy the attributes (ownership, group, ACL, extended attributes, etc.) of one directory to another but not the directory contents itself.  This does not work:  cp -v --attributes-only A B cp: omitting directory `A'              Note: It does not have to be cp. Sometimes I need to upload, embed, or display inline an image in a question or answer. How can I do that? My Logitech G5 Laser mouse has 9 buttons but it's SetPoint software only allows 5 of them to be used as "mouse buttons" and the remaining 4 can only be assigned special windows functions (Forward, Back, Cruise Up, etc) or Keystroke Assignments.  Many of the games I play will take up to 10 "MOUSE BUTTON" inputs for in-game actions but wont recognize the remaining 4 buttons even when assigned keystroke assignments.  Is there a way to make these last 4 buttons "Generic Buttons" as well as buttons 3,4,and 5? (1 is left click and 2 is right click).  My other question is if the above is not possible, maybe I can use AutoHotkey to remap keystrokes as assigned by my SetPoint software to mouse button commands?  If so how? Seating of $n$ people with tickets into $n+k$ chairs with 1st person taking a random seat "$n$ music lovers have reserved seats in a theater containing a total of $n+k$ seats ($k$ seats are unassigned). The first person who enters the theater, however, lost his seat assignment and chooses a seat at random. Subsequently, people enter the theater one at a time and sit in their assigned seat unless it is already occupied. If it is, they choose a seat at random from the remaining empty seats. What is the probability that person $n$, the last person to enter the theater, finds their seat already occupied?"  I could do this problem for small specific values of $n$ and $k$ but as they grow the expressions seem to get really messy really quick with no discernible pattern. How would one solve this problem? How to call a constructor on an already allocated memory? How can I call a constructor on a memory region that is already allocated? The usage of singular and plural has always been confusing for me.   I often see sentences like these         People are using cell phones.   People are using a cell phone.      Does the first sentence mean everyone has a phone and they are all using their own?  Does the second sentence mean they are sharing one cell phone?   If I see a group of people holding a cell phone in their hand(s), &lt;- even this is confusing for me, should I use the first sentence then?   Another example: you see two men, and both of them are carrying a bag. Which sentence should I say/use?        They are carrying backpacks          They are carrying a backpack      Could you please make it clear for me? How do I get started with RAW photography? Having read about the benefits of shooting in RAW as opposed to JPEG (for example ), I'd like to have a go with it myself. However, I'm not really sure how to go about it.  I can turn RAW mode on in my camera (that's easy!), but what do I do with the files when I get them on to my computer? I presume I need to process them to get the RAW data into something that I can work with, but do I need a specific tool for my camera (a Finepix S5100), or will something like the GIMP do what I want? I'm also a little confused about how I then take advantage of the abilities that RAW gives me when I'm processing it on the computer — do RAW processing tools have more processing options than standard tools? Salesforce to Xero integration using Named Credentials by OAuth 2.0 I'm an android developer and have laptop with 4GB RAM. When I compile my project the RAM is used at 100%.    If I add more RAM will it solve the problem? Are getters and setters poor design? Contradictory advice seen I'm currently working on a simple game in Java with several different modes. I've extended a main Game class to put the main logic within the other classes. Despite this, the main game class is still pretty hefty.  After taking a quick look at my code the majority of it was Getters and Setters (60%) compared to the rest that is truly needed for the logic of the game.  A couple of Google searches have claimed that Getters and Setters are evil, whilst others have claimed that they are necessary for good OO practice and great programs.  So what should I do? Which should it be? Should I be changing my Getters and Setters for my private variables, or should I stick with them? How to tell the difference between linear and non-linear regression models? When adjusting the volume in Windows 8.1, a box appears at the top left corner of the screen. This box sticks around for ~13 seconds before it fades away. If you attempt to dismiss it by click on it, it switches to the music app.  How do you disable or dismiss this annoying box? At the very least, can the time visible be adjusted? More times than not, it's in the way. Remove Meta Privilege for MSE (only) What I am asking here is to please remove the privilege to participate in Meta for MSE.  This privilege is literally useless. You can't really have a meta site for a meta site. There's no Meta.Meta.SE here or any other SE site out there: Meta.SE covers for every site in SE, including itself.     When users find out that you don't really get anything new, it's kinda sad for those people. There is no use for it except just to be there and fill up the space between the first and third privilege. Privileges should be shown only if you earn something new, and this privilege to participate in the meta isn't new because it's where you report problems in all of SE, including Meta.SE.    So please remove the privilege to participate in meta just for Meta.SE.    This is not a dupe as this is a feature-request to remove it, not support on why it is there. I want to know where I can find updated information about all the stable and in-development versions of Ubuntu, where I can find this information?     This question is meant to be a canonical question. It expects to answer the following questions:         Is X version stable yet?   Is X version in beta?   Is X version still supported?   What versions are still supported?   What are the versions in Beta/Alpha?   Until where X version will be supported?   Have X version ceased support?   When will be X version released?   Where I can download any release?   When will the next LTS version of Ubuntu be released?         The list is not exhaustive. How can I recover my external hard drive's free space? I had these partitions on an external hard drive:  /dev/disk2 (external, physical):    #:                       TYPE NAME                    SIZE       IDENTIFIER    0:      GUID_partition_scheme                        *2.0 TB     disk2    1:                        EFI EFI                     209.7 MB   disk2s1    2:                  Apple_HFS Android                 63.9 GB    disk2s2    3:                  Apple_HFS RiptideHUP              968.0 GB   disk2s3    4:       Microsoft Basic Data RiptideF                967.8 GB   disk2s4   My aim was to delete disk2s2 and then resize disk2s3 to occupy the leftover space by deleting disk2s2.  I deleted disk2s2 using this command:  diskutil  erasevolume  "Free Space"  ""  /dev/disk2s2   Now, to resize the volume, I used:  diskutil  resizevolume  /dev/disk2s3  R   However, I got this error:  Started partitioning on disk2s3 RiptideHUP Error: -69743: The new size must be different than the existing size   I did a bit of research and realised the free space was created before disk2s3 RiptideHUP so it cannot resize itself. Is there still a way I can reclaim the Free Space?  NOTE: Using diskutil list now shows:  /dev/disk2 (external, physical):    #:                       TYPE NAME                    SIZE       IDENTIFIER    0:      GUID_partition_scheme                        *2.0 TB     disk2    1:                        EFI EFI                     209.7 MB   disk2s1    2:                  Apple_HFS RiptideHUP              968.0 GB   disk2s3    3:       Microsoft Basic Data RiptideF                967.8 GB   disk2s4 Electrolytic Capacitor Voltage Rating vs capacitance I have always believed that it was ok to replace a capacitor with a slightly higher voltage rated one. eg 16v with 25v.Going higher than this would risk the capacitance value being out at the working voltage. However I just read the following quote from this       Electrolytic capacitors are non-ferroelectric with a very low dielectric constant. Their capacitance is derived from a very high surface area and nanometer thick dielectric layers. Their capacitance is not a function of applied voltage.‐Design Solutions For DC Bias In Multilayer Ceramic Capacitors (August 2010 Electronic Engineering Times)   So does this rule not apply to aluminum electrolytics? Eg will I have no issues replacing an electrolytic 25v 100uf with a 50v 100uf assuming both are low esr, similar footprint and good quailty? Normally to remove files with spaces in their filename you would have to run:  $ rm "file name"   but if I want to remove multiple files, e.g.:  $ find . -name "*.txt" | xargs rm   This will not delete files with spaces in them.