473,405 Members | 2,415 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

'&&', '||' and '!' operators allowed in template arguments?

Hi,

Was looking over this paper by Bjarne Straustrup
'http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1510.pdf'
and saw this syntax:

template<Std_printable && value_type T> class X { /* & */ };

(page 19)

Is this real syntax, or am I missing something?
Jul 22 '05 #1
2 1137

"Asfand Yar Qazi" <se*@message.body.com> wrote in message
news:30*************@uni-berlin.de...
Hi,

Was looking over this paper by Bjarne Straustrup
'http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1510.pdf'
and saw this syntax:

template<Std_printable && value_type T> class X { /* & */ };

(page 19)

Is this real syntax, or am I missing something?


I haven't read this paper yet, and www.open-std.org seems to be down, but "&&"
here appears to be a "concept intersection operator". It might help if you read
page 1 before page 19.

Jonathan
Jul 22 '05 #2
Jonathan Turkanis wrote:
"Asfand Yar Qazi" <se*@message.body.com> wrote in message
news:30*************@uni-berlin.de...
Hi,

Was looking over this paper by Bjarne Straustrup
'http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1510.pdf'
and saw this syntax:

template<Std_printable && value_type T> class X { /* & */ };

(page 19)

Is this real syntax, or am I missing something?

I haven't read this paper yet, and www.open-std.org seems to be down, but "&&"
here appears to be a "concept intersection operator". It might help if you read
page 1 before page 19.

Jonathan


On further reading, I still don't understand; but I think its
something to do with new syntax Bjarne's proposing. My mistake.
Jul 22 '05 #3

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

Similar topics

16
by: Steven T. Hatton | last post by:
In the following code, the only way I can figure out to pass an array of const is by setting the template argument to const in the instanciation expression. It would be (or seem to me) better if I...
8
by: Jef Driesen | last post by:
I'm implementing some image processing algorithms in C++. I created a class called 'image' (see declaration below), that will take care of the memory allocations and some basic (mathematical)...
4
by: johkar | last post by:
When the output method is set to xml, even though I have CDATA around my JavaScript, the operaters of && and < are converted to XML character entities which causes errors in my JavaScript. I know...
5
by: jab3 | last post by:
(again :)) Hello everyone. I'll ask this even at risk of being accused of not researching adequately. My question (before longer reasoning) is: How does declaring (or defining, whatever) a...
21
by: siliconwafer | last post by:
Hi, In case of following expression: c = a && --b; if a is 0,b is not evaluated and c directly becomes 0. Does this mean that && operator is given a higher precedence over '--'operator? as...
17
by: orekinbck | last post by:
Hi There Say I want to check if object1.Property1 is equal to a value, but object1 could be null. At the moment I have code like this: if (object1 != null) { if (object1.Property ==...
9
by: Marek Vondrak | last post by:
Hello. I have written the following program and am curious why it prints "1" "2". What are the exact effects of explicitly providing function template parameters at the call? Is the second...
23
by: Hallvard B Furuseth | last post by:
As far as I can tell, (x & -1) is nonzero if the integer x is negative zero. So for signed types, x == 0 does not guarantee (x & foo) == 0. Is that right? (Not that I expect to ever encounter a...
3
by: mathieu | last post by:
Could someone please tell me what is wrong with the following -ugly- piece of c++ code. Why when I explicititely set the template parameter my gcc compiler start getting confused: bla.cxx: In...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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...
0
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
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...

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.