以下是C ++ std文档。文档号为N3721,取代了较早的N3634。
显然,很容易跟踪给定主题的旧文档。
但是,我的问题是:
如何跟踪给定主题的新文档?
例如,如果N3721被较新的文档取代,如何跟踪较新的文档?
答案 0 :(得分:21)
对于较新的提案(以字母public class MoviesFragment extends BaseFragment implements SwipeRefreshLayout.OnRefreshListener,
RecyclerItemClickSupport.OnItemClickListener {
private static final String ARG_FRAG_TYPE = "fragType";
private static final String ARG_FRAG_TWO_PANE = "twoPane";
public enum Type {
POPULAR,
TOP_RATED,
FAVORITES
}
@State
ArrayList<Movie> movies;
@State
Type fragType;
@State
boolean twoPane;
@BindView(R.id.refresh)
SwipeRefreshLayout refreshView;
@BindView(R.id.movies)
RecyclerView moviesView;
public static MoviesFragment newInstance(Type fragType, boolean twoPane) {
MoviesFragment fragment = new MoviesFragment();
Bundle args = new Bundle();
args.putSerializable(ARG_FRAG_TYPE, fragType);
args.putBoolean(ARG_FRAG_TWO_PANE, twoPane);
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Icepick.restoreInstanceState(this, savedInstanceState);
if (getArguments() != null) {
fragType = (Type) getArguments().getSerializable(ARG_FRAG_TYPE);
twoPane = getArguments().getBoolean(ARG_FRAG_TWO_PANE);
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_movies_list, container, false);
unbinder = ButterKnife.bind(this, rootView);
init();
return rootView;
}
@Override
public void onStart() {
super.onStart();
EventBus.getDefault().register(this);
}
@Override
public void onStop() {
EventBus.getDefault().unregister(this);
super.onStop();
}
@Override
public void onRefresh() {
movies = null;
updateMovies();
}
@Override
public void onItemClicked(RecyclerView recyclerView, int position, View v) {
showMovieAtPosition(position);
}
@Subscribe(sticky = true)
public void onEvent(UpdateFavoritesEvent event) {
if (fragType == Type.FAVORITES) {
EventBus.getDefault().removeStickyEvent(UpdateFavoritesEvent.class);
onRefresh();
}
}
@Subscribe(sticky = true)
public void onEvent(TwoPaneEvent event) {
twoPane = event.twoPane;
}
@Override
protected void init() {
RecyclerItemClickSupport.addTo(moviesView)
.setOnItemClickListener(this);
moviesView.setLayoutManager(new GridLayoutManager(getContext(), 2));
moviesView.setHasFixedSize(true);
refreshView.setOnRefreshListener(this);
updateMovies();
}
private void updateMovies() {
if (movies == null) {
MoviesCallback callback = new MoviesCallback() {
@Override
public void success(List<Movie> result) {
movies = new ArrayList<>(result);
if (moviesView != null) {
moviesView.setAdapter(new MoviesAdapter(getContext(), movies));
}
refreshView.setRefreshing(false);
}
@Override
public void error(Exception error) {
Toast.makeText(getContext(), error.getMessage(), Toast.LENGTH_SHORT).show();
error.printStackTrace();
refreshView.setRefreshing(false);
}
};
switch (fragType) {
case POPULAR:
MoviesUtil.getPopularMovies(getActivity(), callback);
break;
case TOP_RATED:
MoviesUtil.getTopRatedMovies(getActivity(), callback);
break;
case FAVORITES:
MoviesUtil.getFavoritesMovies(getActivity(), callback);
break;
}
} else if (moviesView != null) {
moviesView.setAdapter(new MoviesAdapter(getContext(), movies));
refreshView.setRefreshing(false);
}
}
private void showMovieAtPosition(int position) {
if (movies != null && position <= movies.size() - 1) {
Movie movie = movies.get(position);
EventBus.getDefault().postSticky(new ShowMovieEvent(movie));
if (twoPane) {
getFragmentManager().beginTransaction()
.replace(R.id.movie_detail, new MovieFragment())
.commit();
} else {
startActivity(new Intent(getContext(), MovieActivity.class));
}
}
}
}
开头的提案),您可以使用wg21.link redirect service获取最新文档:
P
例如对于wg21.link - WG21 redirect service.
Usage:
wg21.link/nXXXX
wg21.link/pXXXXrX
Get paper.
wg21.link/pXXXX
Get latest public revision of paper.
wg21.link/std
wg21.link/std{11,14,17}
Get working draft.
wg21.link/cwgXXX
wg21.link/ewgXXX
wg21.link/lwgXXX
wg21.link/lewgXXX
wg21.link/fsXXX
wg21.link/editXXX
Get issue.
wg21.link/pXXXX/issue
Get issue for paper.
wg21.link/*wgXXX/paper
Get paper for issue.
wg21.link/index.json
wg21.link/index.ndjson
wg21.link/index.txt
wg21.link/specref.json
Get everything.
wg21.link/
Get usage.
wg21.link/<something else>
Get 404.
If you're Slackbot or Twitterbot:
Get OpenGraph metadata instead.
,如果我们使用wg21.link/P0476,我们将获得最新版本P0476R2。
在对How does the standards committee indicate the status of a paper under consideration?的答复中,我将详细介绍WG21网站以及在该网站上可以找到哪些文档。
如果我们使用wg21 redirect service Get Everything link,我们可以对论文标题进行文本搜索。因此,对于您的示例P0476: Bit-casting object representations
,我们可以看到最后一个文档是N3857:
“ N3857”:{
“ type”:“ paper”,
“ title”:“对std :: future和相关API的改进”,
“ subgroup”:“并发”,
“作者”:“ N。Gustafsson,A。Laksberg,H。Sutter和S. Mithani”,
“ long_link”:“ http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3857.pdf”,
“ link”:“ https://wg21.link/n3857”,
“ source”:“ http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/”,
“ date”:“ 2014-01-16”
},