The Artima Developer Community
Sponsored Link

Java Buzz Forum
New Language Features Galore

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Weiqi Gao

Posts: 1808
Nickname: weiqigao
Registered: Jun, 2003

Weiqi Gao is a Java programmer.
New Language Features Galore Posted: Aug 28, 2007 11:36 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Weiqi Gao.
Original Post: New Language Features Galore
Feed Title: Weiqi Gao's Weblog
Feed URL: http://www.weiqigao.com/blog/rss.xml
Feed Description: Sharing My Experience...
Latest Java Buzz Posts
Latest Java Buzz Posts by Weiqi Gao
Latest Posts From Weiqi Gao's Weblog

Advertisement

Just as Java's new language features buzz is dying down (reified generics no longer being mentioned, etc.) the C++0x standards is nearing completion.

In today's OCI internal C++ lunch, Adam Mitz (who apparently needs a more updated homepage) talked about the new C++ language features that may become available in the updated standard. We've covered the new library features in a previous C++ lunch.

Here's some of the more interesting features.

Raw strings

R"$
A string that may contain embedded
new line characters.
$"

Lambdas

<>(int x, int y) -> int {return x + y; }

Closures

std::cout& os = ...;
setCallback(<>(int i) extern(os) { os << i; });

RValue References

A&& r = getA();

Variadic Templates

template <class... Elements> class tuple;

Alternative syntax for typedef

using callback = void (*)(void*, int);

Type inference

auto pi = 3.1415926535;
const auto& v = map["key"];

Concepts

template <LessThanComparable T> class ...;
auto concept LessThanComparable
<typename T> { bool operator<(T, T); };

Range based for loop

for (int i: vector_of_ints) {
  std::cout << i;
}

String enums

enum class E : unsigned long lone {A, B, C};

And the quote of the day came when Adam answered the question "is this a hack?" with

It's all a hack, but so is the whole language.

For detailed information, Adam points us to JTC1/SC22/WG21 - The C++ Standards Committee Home Page.

Read: New Language Features Galore

Topic: Nobody Told Me Previous Topic   Next Topic Topic: Millisecond accuracy in Java

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use