Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 55 results for
constexpr
- Page 1
Re: "constexpr" Visual Studio 2013 update 2
Programming
Software Development
9 Years Ago
by mike_2000_17
…standard libraries or Boost libraries, they will only use
constexpr
if it is supported by the compiler they are … Although it can probably be used in interesting ways,
constexpr
is mostly a syntactic sugar (for when you need a… is, there probably aren't any important libraries for which
constexpr
is an absolute necessity, at least, not yet. >…
"constexpr" Visual Studio 2013 update 2
Programming
Software Development
9 Years Ago
by Sarkurd
Hi i tried to test some new features of C++ 11 but how come Visual Studio doesn't support `
constexpr
`? i tried this simple function but it won't compile
constexpr
int multiply(int x, int y) { return x * y; }
Re: "constexpr" Visual Studio 2013 update 2
Programming
Software Development
9 Years Ago
by mike_2000_17
From what the guys over at Clang and GCC have said, the
constexpr
feature is actually one of the hardest features to implement from C++11. I think it's because it actually constitutes (another) compile-time Turing complete language on top of C++.
Re: "constexpr" Visual Studio 2013 update 2
Programming
Software Development
9 Years Ago
by vijayan121
> i tried this simple function but it won't compile `
constexpr
int multiply( int x, int y ){ return x*y ; }` The November 2013 CTP will compile it. http://www.microsoft.com/en-us/download/details.aspx?id=41151&751be11f-ede8-5a0c-058c-2ee190a24fa6=True&fa43d42b-25b5-4a42-fe9b-1634f450f5ee=True
Re: "constexpr" Visual Studio 2013 update 2
Programming
Software Development
9 Years Ago
by Sarkurd
Thanks `vijayan121` it worked. i don't know how important is
constexpr
yet, should i use GCC instead of VS?
C++11 Compile-time String Concatenation with constexpr
Programming
Software Development
9 Years Ago
by mike_2000_17
…: template <unsigned int N>
constexpr
literal_str_list(const char(&aStr)[N], const literal_str_list…; (hd_size + text_size) ? text_ptr[i - hd_size] : '\0')); };
constexpr
char operator[](unsigned int i) const { return (head != nullptr ? get_char_from_head…
Re: C++11 Compile-time String Concatenation with constexpr
Programming
Software Development
9 Years Ago
by mike_2000_17
…template <> struct ct_itoa<0> { static
constexpr
literal_str_list text = literal_str_list(""); }; // Define static member …type RIndices; return add_literal_arrays_impl(lhs, LIndices(), rhs, RIndices()); };
constexpr
auto example_str_concat = LSA("Hello ") + LSA("World…
Re: C++11 Compile-time String Concatenation with constexpr
Programming
Software Development
9 Years Ago
by mike_2000_17
… template <> struct ct_itoa<0> { static
constexpr
literal_str_list text = literal_str_list(""); }; // Define static member …outside the template:
constexpr
literal_str_list ct_itoa<0>::text; template <unsigned int…
Re: C++11 Compile-time String Concatenation with constexpr
Programming
Software Development
9 Years Ago
by vijayan121
….substr( 3, 5 ) << '\n' ; // lo wo
constexpr
auto s137 = sprout::to_string( 137 ) ;
constexpr
auto pi = sprout::to_string( double(22) / 7… * 3.142856 = 430.571429 static_assert( eqn <= hello_world, "" ) ;
constexpr
auto hash = sprout::to_hash(eqn) ; std::cout << hash…
Re: C++11 Compile-time String Concatenation with constexpr
Programming
Software Development
9 Years Ago
by mike_2000_17
… want a lean and mean approach that relies only on `
constexpr
`.
c++
Programming
Software Development
11 Years Ago
by logic20
…(since C++11) char32_t(since C++11) class compl const
constexpr
(since C++11) const_cast continue decltype(since C++11) default…
How to update MS Visual studio 2010 express c++?
Programming
Software Development
10 Years Ago
by MasterHacker110
I would like to start using the new fetures of c++0x like the
constexpr
. I currently have visual studio 2010 express c++ and I was wondering if there is a way to update the compiler but still use the same GUI? Oh and if anyone know how to permanantly disable incremental linking. Please let me know.
Help with Hash Table of Objects insertion
Programming
Software Development
10 Years Ago
by g12mcgov
…:206:5: note: template<class _T1, class _T2>
constexpr
bool std::operator==(const std::pair<_T1, _T2>…
Suggest good OPP design for my solution
Programming
Software Development
4 Years Ago
by volan
… false; } bool Winner :: findSymbol( std::string symbol, std::string message ) {
constexpr
std::size_t MAX_DISTINCT_CHAR_VALUES = std::numeric_limits<unsigned char>::max…
Re: C++ This Keyword and Shadowing..
Programming
Software Development
11 Years Ago
by vijayan121
…http://www.stroustrup.com/C++11FAQ.html#
constexpr
constexpr
A() = default ; // x == 0, y == 0
constexpr
explicit A( int x ) :…C++11FAQ.html#delegating-ctor
constexpr
B() : B(0,0,0) {}
constexpr
explicit B( int x )… with 9 when we use an inherited construtor
constexpr
C( int x, int y, int z…
Re: sorting the pair
Programming
Software Development
11 Years Ago
by vijayan121
…::string, std::string, int > ;
constexpr
get_tuple_element<0> title ;
constexpr
get_tuple_element<1> author ;
constexpr
get_tuple_element<2> num_copies…
Re: template parameters as base class - incomprehensible stroustrup
Programming
Software Development
10 Years Ago
by mike_2000_17
…, if you used an alternative to that, like `
constexpr
std::string`, which would have compile-time value semantics… difficult to achieve for strings, because writing a
constexpr
string is pretty hard (but [possible](http://akrzemi1…/)), and it would also imply a
constexpr
comparison function and a
constexpr
hashing function. Now, the compiler could…
Re: Practice Problem: Mapping
Programming
Software Development
12 Years Ago
by mike_2000_17
…Size, unsigned int Index> struct decoding { static
constexpr
std::string value(const int (&arr)[Size]) …gt; struct decoding<Size, Size> { static
constexpr
std::string value(const int (&)[Size]) { return…quot;"; }; }; template <unsigned int Size>
constexpr
std::string decode(const int (&arr)[Size]) { return …
Re: What's wrong with my code
Programming
Software Development
9 Years Ago
by vijayan121
… int` may be inadequate.) #include <iostream> int main() {
constexpr
auto upper_bound = 1'000'000'000'000 ; // C++14 literal… //
constexpr
auto upper_bound = 1000000000000 ; // C++11
constexpr
auto lower_bound = -1'000'000'000'000 ; // …
Re: How to make separate functions to get the mean and standard deviation?
Programming
1 Year Ago
by toneewa
…; using namespace std; //define the dimensions of the grid
constexpr
auto MAX_X = 4;
constexpr
auto MAX_Y = 4; //define the iterations #define ITERATIONS…("The file 'data.txt' was not opened\n"); }
constexpr
double MCSTEPS = 5.0; double sum_1 = 0; double sum_2 = 0…
Re: which kinds of constructors may be applied during compile time as optimization?
Programming
Software Development
13 Years Ago
by vijayan121
> which kinds of constructors can be applied during compile time ? None in C++98; though constructors can be elided as in the case of RV optimization. Objects constructed via the the
constexpr
mechanism in C++0x. [url]http://www2.research.att.com/~bs/C++0xFAQ.html#
constexpr
[/url]
Re: template parameters as base class - incomprehensible stroustrup
Programming
Software Development
10 Years Ago
by mike_2000_17
… is that the string literal is (presumably) converted to a `
constexpr
` `std::string` object and that that object is used as… as template value parameters (only integral types), and (2) a `
constexpr
` string is not even a literal type because it is…
Re: Birthday paradox problem
Programming
Software Development
2 Years Ago
by toneewa
… z = 0; int counter = 0; double dup = 0;
constexpr
int MIN = 1;
constexpr
int MAX = 365; std::srand(static_cast<unsigned int…
Re: Trigonometric Function Optimization
Programming
Software Development
12 Years Ago
by mike_2000_17
… can use C++0x, you should mark those functions with
constexpr
keyword to allow compile-time computation of the values whenever…
Re: Trigonometric Function Optimization
Programming
Software Development
12 Years Ago
by mrnutty
… can use C++0x, you should mark those functions with
constexpr
keyword to allow compile-time computation of the values whenever…
Re: C++0x Tutorial and Examples
Programming
Software Development
12 Years Ago
by mike_2000_17
…;. I'm thinking "auto", initializer_list, lambdas, rvalue-references,
constexpr
, range for-loops, decltype(), variadic templates, etc. I guess the…
Re: C++ C-Style Type Casting
Programming
Software Development
12 Years Ago
by mike_2000_17
…] #include <type_traits> template<class T> inline
constexpr
bool IsValidUnsignedLong(T) { return std::is_unsigned<T>::value…
Re: C++0x Compiler
Programming
Software Development
12 Years Ago
by dospy
…/array/pointer>) [/CODE] is not valid same goes for '
constexpr
' and many more.. for more vizit [url]http://blogs.msdn…
Re: How can I a string from a . txt, reverse it and write it to another .txt in C++?
Programming
Software Development
12 Years Ago
by vijayan121
… at compile-time. [CODE]std::string reverse_amount( std::string amount ) {
constexpr
char DOT = '.' ; auto dot_pos = amount.find( DOT ) ; // locate the dot…
Re: Restricting string input size - C vs. C++ strings
Programming
Software Development
12 Years Ago
by vijayan121
… too long is simpler. Something like: [code] std::string name ;
constexpr
std::string::size_type MAX_CHARS = 20 ; if( std::cout <<…
1
2
Next
Search
Search
Forum Categories
Hardware/Software
Programming
Digital Media
Community Center
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Meet People
Forums
Top Members
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2024 DaniWeb® LLC