473,486 Members | 2,493 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

static const T vs static T const

er
hi all,

probably a simple question: i'm used to static const T, i can also
understand static const T* const, but i'm not sure what this, for
example, means:

template <class T>
struct my_struct
{
static bool const value = false;

};

thanks!
Jun 27 '08 #1
3 2023
On Apr 22, 3:10 pm, er <erwann.rog...@gmail.comwrote:
probably a simple question: i'm used to static const T, i can also
understand static const T* const, but i'm not sure what this, for
example, means:
static bool const value = false;
'static' doesn't add anything to the question. It is not different
than the fact that there is no difference between these two:

Type const o;
const Type o;

So it's the same thing.

Ali
Jun 27 '08 #2
"er" <er***********@gmail.comwrote in message
hi all,

probably a simple question: i'm used to static const T, i can also
understand static const T* const, but i'm not sure what this, for
example, means:

template <class T>
struct my_struct
{
static bool const value = false;
Same as static const bool val = ..

--
http://techytalk.googlepages.com
Jun 27 '08 #3
er
On Apr 22, 6:20 pm, "sk_usenet" <sometechyguy at gmail dot comwrote:
"er" <erwann.rog...@gmail.comwrote in message
hi all,
probably a simple question: i'm used to static const T, i can also
understand static const T* const, but i'm not sure what this, for
example, means:
template <class T>
struct my_struct
{
static bool const value = false;

Same as static const bool val = ..

--http://techytalk.googlepages.com
thank you both.
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
9489
by: Rahul Joshi | last post by:
Hi, Is it possible to define static member functions that are 'const', i.e. they just read but do not modify the static data members of a class? Declaring functions like: class SomeClass {...
2
550
by: Seb | last post by:
I am trying to initialize a const static object data member in a header file? The following code errs. class Object { public: virtual const char* ToString() { return "Object"; } virtual...
10
21208
by: Dave | last post by:
const static int ARRAY_SIZE = 4; Comeau online gives this warning: "ComeauTest.c", line 10: warning: storage class is not first const static int ARRAY_SIZE = 4; Why is static const...
2
4729
by: Susan Baker | last post by:
Hi, I got this error msg whilst building some classes. It is realatively asy to fix. But I just wondered, does anyone know the technical reason why one can't initialiaze a const static...
8
2367
by: nilavya | last post by:
Hi Gurus, Since I learned C++, way back in 2002, I always had a doubt about the different types of storage in C++. We have "const", "static" , "#define" for one or other purpose. Now I have a...
3
3299
by: Russell Mangel | last post by:
Hi, I would like to encapsulate the following CRC32 routine inside a C++ un-mananged class. I am having difficulty initializing the "const static unsigned int table" inside an un-managed C++...
2
1964
by: psujkov | last post by:
Hi everybody, let us have some class A with const static int variable var with compile-time well-known value. let us have some function f(), which has return type of A. and let us have some...
9
6875
by: t | last post by:
Lippman's C++ Primer says that if you initialize a const static data member in a class, you still need to define the member outside the class but without an initializer. I tried it using Visual...
15
7836
by: akomiakov | last post by:
Is there a technical reason why one can't initialize a cost static non- integral data member in a class?
5
3046
by: Bob Doe | last post by:
I have a const static object. What is the right syntax to get a reference to the std::vector within the std::map variable?: class MyObj { public: ... std::map<std::string,...
0
7105
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6967
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7132
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7180
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6846
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5439
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4870
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4564
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1381
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.