This reply might be more Wikipedia policy-based, instead of Stack Exchange policy-based, but I'd like to provide some perspective from our (and by "our" I mean Wikipedia's) point of view:
According to Wikipedia policy, Stack Exchange sites should never be cited in the text of a Wikipedia article as a reference. Wikipedia does not consider Stack Exchange a reliable source pursuant to Wikipedia:Identifying reliable sources§Self-published sources (online and paper) ("self-published media [...] are largely not acceptable. This includes any website whose content is largely user-generated[...].") and Wikipedia:Verifiability§Self-published sources.
To cite Stack Exchange where we use Stack Exchange content (that is, where we are required to provide attribution to use the text in accordance with the CC BY-SA 3.0, which both Wikipedia and Stack Exchange use for all content), please see Wikipedia:Plagiarism§Copying material from free sources. Specifically, place the template Template:CCBYSASource directly in the references section of the Wikipedia article, for example:
{{CCBYSASource
|sourcepath = http://stackoverflow.com/q/31387778
|sourcearticle = Near constant time rotate that does not violate the standards?
|revision = 675766097
|author(s) = [http://stackoverflow.com/users/608639/jww jww] at Stack Exchange }}
Which would produce:

Again, this is only used when text from the original question or answer is copied directly or closely paraphrased into the Wikipedia article. This should not be used when the Stack Exchange question or answer was used only for research.
I'd like to emphasize that I do not formally represent Wikipedia or the Wikimedia Foundation in any way. I am simply a regular, policy-familiar editor of the English Wikipedia who goes by User:L235.