- std::complex and std::pow - 3 Updates
- Determining endianess at compile time - 1 Update
- Aliases - 3 Updates
- Rogue Wave (Re: RWCollectable Replacement) - 1 Update
Christopher Pisz <nospam@notanaddress.com>: May 21 05:19PM -0500 Trying to update my project to use a newer compiler. It started complaining about my use of std::pow being ambiguous and having multiple overloads to choose from. From what I can tell std::pow now uses something called std::complex. I looked that up and it represents complex numbers. Fair enough. I don't need to deal with a complex number, but I don't know if I have to use it to get the solution to x^y. Is this how I am supposed to use it? const std::string fractionalPart = "123456789" const double inputTicksPerSecond = std::pow<double>(std::complex<double>(10.0), std::complex<double>(fractionalPart.size())).real(); I'm a bit confused. -- I have chosen to troll filter/ignore all subthreads containing the words: "Rick C. Hodgins", "Flibble", and "Islam" So, I won't be able to see or respond to any such messages --- |
Barry Schwarz <schwarzb@dqel.com>: May 21 04:01PM -0700 The fact that there is a complex version of pow only comes into play if you actually call the function with at least one complex argument. Otherwise you end up with the "real" version of the function. Is your compiler C++98 or C++11? The two versions have different prototypes. Why don't you show us the actual types of x and y and the error message that is generated when you compile the expression pow(x,y). On Thu, 21 May 2015 17:19:29 -0500, Christopher Pisz -- Remove del for email |
Christopher Pisz <nospam@notanaddress.com>: May 21 06:14PM -0500 On 5/21/2015 6:01 PM, Barry Schwarz wrote: >> std::pow<double>(std::complex<double>(10.0), >> std::complex<double>(fractionalPart.size())).real(); >> I'm a bit confused. Top posting is frowned upon. I did show the types: x = 10.0 y = fractionalPart.size() with fractionalPart being an std::string Both the old and new compilers are C++98 afaik. I went from Visual Studio 2012 using the 2010 platform toolset to 2013 using the 2010 platform toolset. The error is that it is an ambiguous call between global pow, <cmath> pow and <complex> pow. The actual error message is too long for me to be happy with copy pasting it. I think I can solve this problem just by using ::pow instead of std::pow. -- I have chosen to troll filter/ignore all subthreads containing the words: "Rick C. Hodgins", "Flibble", and "Islam" So, I won't be able to see or respond to any such messages --- |
legalize+jeeves@mail.xmission.com (Richard): May 21 07:40PM [Please do not mail me a copy of your followup] slp53@pacbell.net spake the secret code >That's why I'm also comfortable using dual leading underscores for >defines, because when I do, it _is_ part of the implementation. If you're implementing the standard library, then double underscore identifiers are reserved for you. If you're not implementing the standard library, then you shouldn't have any identifiers containing double underscores. It's really that simple, but so many people (including tool vendors happily generating code from templates that creates application code using reserved identifiers) do not know this or understand it. -- "The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline> The Computer Graphics Museum <http://computergraphicsmuseum.org> The Terminals Wiki <http://terminals.classiccmp.org> Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com> |
Victor Bazarov <v.bazarov@comcast.invalid>: May 20 09:36PM -0400 On 5/20/2015 3:54 PM, Doug Mika wrote: > ie > vector<int> vi(1)={1}; > Element_type<vi> i; //would this be identical to int i;? or how about this: This should not compile - 'Element_type' template needs a *type* as its argument, and 'vi' is NOT a type. How many times do I need to repeat this? > Element_type<vector<int>> i;//int i; ? Yes, this ought to work. Why don't you just try it? Afraid or something? V -- I do not respond to top-posted replies, please don't ask |
Doug Mika <dougmmika@gmail.com>: May 20 09:37PM -0700 On Wednesday, May 20, 2015 at 8:36:47 PM UTC-5, Victor Bazarov wrote: > V > -- > I do not respond to top-posted replies, please don't ask I hate to admit it, but I don't have my compiler installed on the machine I was on...sorry |
Victor Bazarov <v.bazarov@comcast.invalid>: May 21 07:46AM -0400 On 5/21/2015 12:37 AM, Doug Mika wrote: >> -- >> I do not respond to top-posted replies, please don't ask > I hate to admit it, but I don't have my compiler installed on the machine I was on...sorry There is always http://www.tutorialspoint.com/compile_cpp_online.php if you have access to web... V -- I do not respond to top-posted replies, please don't ask |
"Öö Tiib" <ootiib@hot.ee>: May 20 11:06PM -0700 On Wednesday, 20 May 2015 21:07:12 UTC+3, Jorgen Grahn wrote: > before my time. Feels good to, for once, have missed something > because you're too young ... > What's its legacy, by the way? Typing it to Google reveals that "legacy" is mentioned in URL of its vendor's online documentation: http://docs.roguewave.com/legacy-hpp/tlsref/rwcollectable.html > I'm guessing it was radically > different in scope and philosophy compared to the STL. Philosophy (and naming) look Smalltalk-like. May be it was made to simplify migrating something from Smalltalk to C++. For C++ it feels too over-engineered and intrusive. For example to achieve persistence of an array of ints you can keep them in a "RWBag" as "RWCollectableInt"s. > Are any of the ideas alive today? It feels likely that equivalent code in Java or in C# will both look and perform better than C++ with such classes. |
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
No comments:
Post a Comment